I have feature classes in a personal geodatabase on a Win 8.1 machine (r 3.4.2, rgdal 1.2-15) and, as mentioned here, there is a requirement for Access users to also interact with them.
I have adjusted the code sample found here (which works perfectly for a file geodatabase):
require(rgdal)
# The input personal geodatabase
pgdb <- "C:/path/to/your/personalgeodatabase.mdb"
# Confirm the PGeo driver is available
subset(ogrDrivers(), grepl("PGeo", name))
Which returns:
name long_name write copy isVector 49 PGeo ESRI Personal GeoDatabase FALSE FALSE TRUE
Then, at this point, ogrListLayers(dsn) fails:
# List all feature classes in a personal geodatabase
fc_list <- ogrListLayers(pgdb)
Error in ogrListLayers(pgdb) : Cannot open data source
I have tried adding path.expand:
fc_list <- ogrListLayers(path.expand(pgdb))
And I have also confirmed that for gdal (and so rgdal), that
Personal Geodatabases are accessed by passing the file name of the .mdb file to be accessed as the data source name. On Windows, no ODBC DSN is required.
I successfully accessed the feature classes using R-ArcGIS but that requires an ArcGIS licence, and so does not really solve the problem.
Suggestions?
ogrinfoon the command line? I see more informative errors from that than fromrgdal::ogrInfo, but I'm on Linux so I think my problem with a test PGeo is ODBC-related. – Spacedman Dec 19 '17 at 16:15@Spacedman as suggested I ran ogrinfo from the command line and it failed but I suspect this result may send us off topic since I had this odd success with rgdal::ogrInfo (see previous comment)
– wadlooper Dec 20 '17 at 19:52