Это делается через IPropertySet, приблизительно таким образом:
Dim pPropset As IPropertySet
Set pPropset = New PropertySet
Dim pFact As IWorkspaceFactory
Dim pWorkspace As IWorkspace
Select Case iWorkspaceConnect
Case enumGeodatabase ' Geodatabase (SDE)
With pPropset
.SetProperty "Server", "hephaestus"
.SetProperty "Instance", "sde8_mss"
.SetProperty "Database", "sde"
.SetProperty "user", "sde"
.SetProperty "password", "go"
.SetProperty "version", "sde.DEFAULT"
End With
Set pFact = New SdeWorkspaceFactory
MsgBox "Geodatabase"
Case enumPersonalGeodatabase ' Personal Geodatabase (Access)
pPropset.SetProperty "DATABASE", "d:\\data\\Access Data\\SDETest.mdb"
Set pFact = New AccessWorkspaceFactory
MsgBox "Personal Geodatabase"
Case enumShape ' Shapefile
pPropset.SetProperty "DATABASE", "D:\\data\\SDEtestData\\Greeley"
Set pFact = New ShapefileWorkspaceFactory
MsgBox "Shapefile"
Case enumCoverage ' Coverage
pPropset.SetProperty "DATABASE", "D:\\data\\Coverage"
Set pFact = New ArcInfoWorkspaceFactory
MsgBox "Coverage"
End Select
' Open the Workspace
Set pWorkspace = pFact.Open(pPropset, Me.hWnd)
Dim pFeatureWorkspace As IFeatureWorkspace
Set pFeatureWorkspace = pWorkspace
' Open the FeatureClass
' Coverage data requires that the addition of the geometry type
' when opening the feature class (in this case polgon). The
' feature class name is separated from the geometry type with a
' ":".
Dim pFeatureClass As IFeatureClass
If iWorkspaceConnect = enumCoverage Then
Set pFeatureClass = pFeatureWorkspace.OpenFeatureClass("parcels:polygon")
Else
Set pFeatureClass = pFeatureWorkspace.OpenFeatureClass("parcels")
End If