А так не получается ?
Dim pMap As IMap
Set pMap = MapControl1.Map
Dim pWF As IWorkspaceFactory
Dim pFWS As IFeatureWorkspace
Dim pTable As ITable
Set pWF = New AccessWorkspaceFactory
Set pFWS = pWF.OpenFromFile("d:\db2.mdb", 0)
Set pTable = pFWS.OpenTable("TableXY")
Dim pDataSet As IDataset
Dim pTableName As IName
Set pDataSet = pTable
Set pTableName = pDataSet.FullName
' Specify the X and Y fields
Dim pXYEvent2FieldsProperties As IXYEvent2FieldsProperties
Set pXYEvent2FieldsProperties = New XYEvent2FieldsProperties
With pXYEvent2FieldsProperties
.XFieldName = "X"
.YFieldName = "Y"
.ZFieldName = ""
End With
' Specify the projection
Dim pSpatialReferenceFactory As ISpatialReferenceFactory
Dim pProjectedCoordinateSystem As IProjectedCoordinateSystem
Set pSpatialReferenceFactory = New SpatialReferenceEnvironment
Set pProjectedCoordinateSystem = _
pSpatialReferenceFactory.CreateProjectedCoordinateSystem(esriSRProjCS_NAD1983UTM_11N)
' Create the XY name object and set it's properties
Dim pXYEventSourceName As IXYEventSourceName
Dim pXYName As IName
Dim pXYEventSource As IXYEventSource
Set pXYEventSourceName = New XYEventSourceName
With pXYEventSourceName
Set .EventProperties = pXYEvent2FieldsProperties
Set .SpatialReference = pProjectedCoordinateSystem
Set .EventTableName = pTableName
End With
Set pXYName = pXYEventSourceName
Set pXYEventSource = pXYName.Open
' Create a new Map Layer
Dim pFlayer As IFeatureLayer
Set pFlayer = New FeatureLayer
Set pFlayer.FeatureClass = pXYEventSource
pFlayer.Name = "Sample XY Event layer"
'Add the layer extension (this is done so that when you edit
'the layer's Source properties and click the Set Data Source
'button, the Add XY Events Dialog appears)
Dim pLayerExt As ILayerExtensions
Dim pRESPageExt As New XYDataSourcePageExtension
Set pLayerExt = pFlayer
pLayerExt.AddExtension pRESPageExt
pMap.AddLayer pFlayer
MapControl1.ActiveView.Refresh