11

Is it possible to open an Esri Personal Geodatabase (*.mdb; ArcGIS 10.2) in QGIS 2.6? Previous versions were right.

  • 3
    Have you tried this and received an error or are you asking if there's an option available to open ESRI PGDB in QGIS 2.6? The option is available in Layer > Add Layer > Add Vector Layer > Database > select ESRI Personal GeoDatabase as Type – Joseph Jan 8 '15 at 11:09
  • Are you using 64 bit version of QGIS on Windows? – nmtoken Mar 20 '15 at 12:51
  • I've tried to do this but doesn't allow me to save the qgis.bat file with the changes. Any idea? Thanks – NandoSC Sep 17 '15 at 13:23
20

If you have installed a 64-bit version of QGIS on Windows and you find that Personal GeoDatabases (*.mdb) no longer work for you, then this solution might apply; I'm on QGIS 2.8.1 rather than 2.6, but I assume that the issue and thus the solution is the same.

The underlying issue relates to this GDAL bug: Problem reading MDBs (64-bit)

Step 1

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

If you don't have a 32-bit version of office installed you can just run the executable. If however you do have a 32-bit office installation you will need to run the executable from a command prompt using the /passive option

Installing 64-bit Access Database Engine 2010 Redistributable in passive mode

Step 2

Locate the qgis.bat file (mine is in C:\OSGeo4W64\bin\qgis.bat for example).

Add the following two lines:

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

Step 3

Open QGIS and drag the mdb file onto your workspace

Voila!

  • This just worked for me on 64-bit QGIS 3.0.0 on Windows 8.1. – Brian Fisher Mar 21 '18 at 23:29
7

Provided you have successfully installed Microsoft Access Database Engine 64 bit, you can:

Method 1 (works with QGIS 2)

add the following two lines:

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

in your qgis.bat / qgis-grass7.bat / qgis-ltr.bat / qgis-ltr-grass7.bat before the last line, that usually is something like

start "QGIS" /B "%OSGEO4W_ROOT%"\bin\qqis...

[note that there are two percent signs in the value of PGEO_DRIVER_TEMPLATE variable]

Method 2 (works with QGIS 3)

In QGIS Settings panel -> Options | System | Environment add the following two variables:

variable name: OGR_SKIP 
value: ODBC

variable name: PGEO_DRIVER_TEMPLATE 
value: DRIVER=Microsoft Access Driver (*.mdb, *.accdb);DBQ=%s

and check the "Use custom variables" checkbox

[note that in this case there is only one percent sign in the value of PGEO_DRIVER_TEMPLATE variable]

Method 3 (works with both QGIS 2 and QGIS 3)

In the Environment Variables panel of the Windows Advanced System Settings, set the following two new variables as User Variables or System Variables:

variable name: OGR_SKIP 
value: ODBC

variable name: PGEO_DRIVER_TEMPLATE 
value: DRIVER=Microsoft Access Driver (*.mdb, *.accdb);DBQ=%s

[note that also in this case there is only one percent sign in the value of PGEO_DRIVER_TEMPLATE variable]

  • For me it works for ESRI .mdb but I am not sure also for geomedia mdb? Anyone have experience about this kind of files – Roberto Marzocchi May 14 at 10:27
1

The solution proposed works fine also on windows 10. Only a further suggestion for adding the two line to the qgis.bat file.

The two line are setting. So it is important to add the lines before the start of the command.

Probably it is undestood but if you are not careful, there is a risk of being mistaken.

  • Since this is the most recent answer I want to comment that it works but I can only get to load the feature classes (vector layer) but I do not see how to load the tables and relationships contained inside the mdb. Feature datasets are also ignored. – nanunga Jun 14 '18 at 0:44

protected by Aaron Jan 30 '17 at 13:25

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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