Hello everyone,
In ArcGIS 10.2 with VS 2012 the line:
workspaceFactory.OpenFromFile(connectionFile, 0)
returns the error message:
"Error HRESULT E_FAIL has been returned from a call to a COM component."
Public Function ArcSdeWorkspaceFromFile(ByVal connectionFile As String) As IWorkspace
Try
Dim factoryType As Type = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory")
Dim workspaceFactory As IWorkspaceFactory = CType(Activator.CreateInstance(factoryType), IWorkspaceFactory)
Return workspaceFactory.OpenFromFile(connectionFile, 0) ############## RETURNS AN ERROR
Catch ex As Exception
Debug.writeline(ex.Message)
Return Nothing
End Try
End Function
' Add IIS account IIS_IUSRS to the folder where SDE Connection files are located in read only access
' Fodler is listed in <add key="connectionSDE" value="C:\SDEConn\MySDEGeodatabase.sde"/>