Select to view content in your preferred language

open an mdb or accdb in arcpro sdk

635
2
10-06-2023 07:17 AM
ToddDoerr1
New Contributor

I'm migrating a Desktop Add-in to ArcPro.

The code opens an .mdb file using adodb and reads and writes to it.

I can't get any of the COM Microsoft ActiveX Data Objects (adodb) libraries to work with the  'ArcGIS Pro Module Add-in' template.  I get the same error with all versions when I try to open my connection:

"Provider cannot be found. It may not be properly installed."

Changing the ADODB --> 'Embed Interop Type' property to 'No' doesn't help either.  I still get the same error.

Any ideas how I can open an mdb (or even an accdb) file using the ArcGIS Pro sdk?

0 Kudos
2 Replies
SteveCole
Honored Contributor

At the risk of telling you something you already know, ESRI doesn't directly support MS Access in Pro but it is technically possible using OLE connections. ESRI has a blog post about this so I think you'll need to find the appropriate SDK bits that accomplish what is described in the blog post.

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

This article explains the reasons why support for personal geodatabases was dropped with ArcGIS Pro: It's Not Personal: A quick history of the geodatabase and why personal geodatabases are not in ArcGI...

What release of ArcGIS Pro are you using?   You can write a 'Plug-in Datasource' extension using the Pro SDK to implement a reader for your .MDB access database (aka 'personal geodatabase').  'Plug-in Datasources' only allow read access to the data and hence there is no easy way to write to an access database. 

I would suggest writing your ArcGIS Pro add-in so that it reads and writes to a File Geodatabase instead of the old 'personal geodatabase'.  

Let me know if you're interested in the 'personal geodatabase Plug-in DataSource' for ArcGIS Pro.   I can probably find the code for that.  I think the Plug-in DataSource is using this NuGet to access the .MDB files:
NuGet Gallery | System.Data.OleDb 7.0.0  This will work in you x64 Add-in but is limited to access of tabular data only (no spatial data).

0 Kudos