Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I´m trying to read ESRI personal geodabase.mdb through OGR.I have my driver "PGeo" but when I write

ogrinfo INFLOR090812.mdb

I have this bug ERROR 1: Unable to initialize ODBC connection to DSN for DRIVER=Microsoft Access Driver (.mdb);DBQ=INFLOR090812.mdb, [Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'. ERROR 1: Unable to initialize ODBC connection to DSN for DRIVER=Microsoft Access Driver (.mdb);DBQ=INFLOR090812.mdb, [Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'.

Someone could connect to a database.mdb to read the shapefiles in mapserver?

Thank in advance

share|improve this question
    
did you read through everything on the ogr ESRI Personal Geodatabase format page? gdal.org/ogr/drv_pgeo.html –  neuhausr Aug 10 '12 at 13:47

1 Answer 1

As noted in a comment by neuhausr there is a documented solution for this problem on the GDAL site GDAL info page for ESRI Personal GeoDatabase, but the solution is only for Linux.

If like me you find yourself on a 64-bit Windows platform and have 64-bit MapServer/GDAL you might find yourself scratching your head, as yes you can get the same error :-(

msDrawMap(): Image handling error. Failed to draw layer named 'OGE_1M_surface_GeologicUnit'. msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `OGE_1M_surface_GeologicUnit'. Unable to initialize ODBC connection to DSN for DRIVER=Microsoft Access Driver (*.mdb);DBQ=C:/WxS/ms/apps/published/BGS_OGE_Bedrock_and_Surface_Geology/data2/OGE.mdb, [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

For me the solution was as follows:

Download/install the 64-bit version of the ODBC driver: Microsoft Access Database Engine 2010 Redistributable

Now in your MapServer map file you need to add the following two CONFIG options:

CONFIG "PGEO_DRIVER_TEMPLATE" "DRIVER=Microsoft Access Driver (*.mdb, *.accdb);DBQ=%s"
CONFIG "OGR_SKIP" "ODBC"

These config options are discussed in GDAL bug 5594 ~ Problem reading MDBs (64-bit)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.