I'm new at Arcobjects programming. Currently I'm trying to make an ArcMap Add-in which can connect and load a database into ArcMap. I have found samples on the Esri website, but it seems not to be working for me.

Here's the code:

' For example, path = "C:\myData\mypGDB.mdb".'

Public Function AccessWorkspaceFromPath(ByVal Path As String) As IWorkspace 

  Dim workspaceFactory As IWorkspaceFactory = New AccessWorkspaceFactoryClass()
  Return workspaceFactory.OpenFromFile(Path, 0)

End Function

What seems to be the problem is the Microsoft Visual Studio can't recognize the class AccessWorkspaceFactoryClass().

Does anyone have an idea to solve this issue?

  • Many things can go wrong when porgramming with ArcObjects. I would certainly recommend doing a proper training if you want to do this. That said, did you add a reference to ESRI.ArcGIS.DataSourcesGDB to your VS project?
    – Berend
    Commented Oct 31, 2017 at 9:48
  • Have you referenced and imported DataSourcesGDB? You should have a line Imports ESRI.ArcGIS.DataSourcesGDB as the AccessWorkspaceFactory resources.arcgis.com/en/help/arcobjects-net/componenthelp/… is in the DataSourcesGDB reference (note the line on the link that says ArcObjects Library Reference (DataSourcesGDB) ) have a quick read of gis.stackexchange.com/questions/129456/… to understand how to use the ArcObjects help to discern which references to import. Commented Nov 5, 2017 at 22:46


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.