Hi all,
I have a personal ms access database file that is created using ArcMap.
I am trying to load features from it using AxMap.AddLayerFromDatabase() but the code always fails to open it.
See Sample:
When I use non-spatial ms access database for login for example, it works without problem. But I copied all my tables from it to a ArcMap personal geodatabase it does not open.
Help please.
Please share your connection string. It’s unclear whether you are trying to connect to the MS Access database or the ESRI Personal Geodatabase created from the Access database; and they would use different drivers (included in the connection string, see the documentation here).
We use GDAL for database access (anything other than Shapefiles) and I’m not sure if the ESRI driver is built-in by default. Check out the FileGDB driver here.
Dear Mr. Jerry, thank you for you replay.
Connection String: “Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\Projects\root\data\gisdb.mdb; Jet OLEDB:Database Password=123;”
Database gisdb.mdb is ESRI personal geodatabase which is .MDB format.
Hope I made myself clear.
I’m sorry I can’t be more help. I’m not familiar with this method of data access, but it looks like it can be done. Here is the GDAL documentation for the Personal GeoDatabase, in case it helps. Otherwise, perhaps someone else has had some experience with this and can provide some advice.