Когда открывается ShapefileWorkspace, нужно указывать фолдер, а не имя шейп-файла. Затем уже из этого Workspace нужно открывать shapefile FeatureClass:
Public Function OpenShapeFile(dir As String
, name As String
) As
IFeatureClass
Dim
pWSFact As
IWorkspaceFactory
Dim
connectionProperties As
IPropertySet
Dim
pShapeWS As
IFeatureWorkspace
Dim
isShapeWS As Boolean
Set
OpenShapeFile = Nothing
Set
pWSFact = New
ShapefileWorkspaceFactory
isShapeWS = pWSFact.IsWorkspace(dir)
If
(isShapeWS) Then
On Error GoTo
errhandler
Set
connectionProperties = New
PropertySet
connectionProperties.SetProperty "DATABASE", dir
Set
pShapeWS = pWSFact.Open(connectionProperties, 0)
Dim
pFClass As
IFeatureClass
Set
pFClass = pShapeWS.OpenFeatureClass(name)
Set
OpenShapeFile = pFClass
End If
errhandler:
End Function