wiki:PGeo

OGR PGeo Driver

This page collects notes about OGR PGeo driver.

The PGeo driver works very well on Windows. On Unix-like systems, it uses unixODBC with MDB Tools driver (libmdbtools) and the driver is unstable and broken in some places (refer notes below and PGeo driver manual for details).

See also MDBTools wiki page.

mloskot says:

The MDB Tools projects seems to be orphaned and not actively developed, so the driver is neither complete nor stable. This is mostly the reason of problems with using .mdb files on Unix-like systems. In my opinion, it's strongly recommended to not to use .mdb format on Unix in production.

DSN-less Connection Notes

Generally, DSN-less connection is broken in MDB Tools. Here is post about this DSN-less connection not supported? sent to mdbtools-dev list but no reply has arrived so far. The libmdbtools expects DSN token in connection string, so opening .mdb file directly fails. This problem was identified in version mdbtools-0.6pre1 but mdbtools-0.5.99.0.6pre1.0.20050409 worked fine.

As manual recommendeds, the best option is to open Personal Geodatabase (.mdb file) using configured DSN connection. However, if one needs to open .mdb file directly, here is small patch for MDB Tools' file src/odbc/odbc.c:

--- mdbtools-0.6pre1/src/odbc/odbc.c    2004-05-30 10:06:43.000000000 +0200
+++ patched/mdbtools-0.6pre1/src/odbc/odbc.c    2006-05-23 23:08:54.000000000 +0200
@@ -156,7 +156,8 @@
 
    params = ((ODBCConnection*) hdbc)->params;
 
-   if (!(dsn = ExtractDSN (params, szConnStrIn)))
+   /* XXX - mloskot DSN-less connection
+    * if (!(dsn = ExtractDSN (params, szConnStrIn)))
    {
       LogError ("Could not find DSN in connect string");
       return SQL_ERROR;
@@ -168,6 +169,7 @@
    }
    else 
    {
+   */
       SetConnectString (params, szConnStrIn);
 
       if (!(database = GetConnectParam (params, "Database")))
@@ -175,7 +177,7 @@
         LogError ("Could not find Database parameter");
         return SQL_ERROR;
       }
-   }
+   /* }*/
    ret = do_connect (hdbc, database);
    return ret;
 }

The patch above only disables test of DSN token presence, so it would need some improvements before including it to the MDB Tools mainstream.

Last modified 14 months ago Last modified on Mar 9, 2023, 11:29:41 PM
Note: See TracWiki for help on using the wiki.