[gdal-dev] access attribute (non-spatial) data in .mdb with PGeo Driver

Eli Adam eadam at co.lincoln.or.us
Mon Nov 14 14:44:35 EST 2011


Hi all,

On Windows, I'm trying to access non-spatial tables in an .mdb file.
With --debug on I see that the absence of a 'GDB_GeomColumns' table is
the problem.

>ogrinfo --debug on Surveys.mdb
PGeo: EstablishSession(DRIVER=Microsoft Access Driver (*.mdb);DBQ=Surveys.mdb)
ODBC: SQLDriverConnect(DRIVER=Microsoft Access Driver (*.mdb);DBQ=Surveys.mdb)
PGEO: SELECT on GDB_GeomColumns fails, perhaps not a personal geodatabase?
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cann
ot find the input table or query 'GDB_GeomColumns'.  Make sure it exists and tha
t its name is spelled correctly.
ODBC: SQLDisconnect()

I noticed this fairly recent commit, which seems to indicate that this
is the desired behavior, http://trac.osgeo.org/gdal/changeset/21550

I was able to access the non-spatial attributes by making a
'GDB_GeomColumns' table and falsely populating it (and ignoring the
missing 'GDB_SpatialRefs' table errors).

TableName	FieldName	ShapeType	ExtentLeft	ExtentBottom	ExtentRight	ExtentTop	IdxOriginX	IdxOriginY	IdxGridSize	SRID	HasZ	HasM
Survey	Shape	4	7255394.59721669	241841.239197335	7396378.9177745	524650.461230004	0	0	141508.958339791	1	0	0

>ogrinfo -so Surveys.mdb Survey
ERROR 1: 'SELECT srtext FROM GDB_SpatialRefs WHERE srid = 1' failed.
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cann
ot find the input table or query 'GDB_SpatialRefs'.  Make sure it exists and tha
t its name is spelled correctly.
INFO: Open of `Surveys.mdb'
      using driver `PGeo' successful.

Layer name: Survey
Geometry: Unknown (any)
Feature Count: 20790
Extent: (7255394.597217, 241841.239197) - (7396378.917775, 524650.461230)
Layer SRS WKT:
(unknown)
Geometry Column = Shape
DocumentName: String (25.0)
SurveyDate: DateTime (19.0)
...


If the general case requires a 'GDB_GeomColumns' table, could no
'GDB_GeomColumns' table be made a driver config option?

I noticed that the new Access MDB driver,
http://gdal.org/ogr/drv_mdb.html , does not require a GDB_GeomColumns
table (tested on ubuntu 10.04 and gdal trunk).


Thanks, Eli


More information about the gdal-dev mailing list