[Gdal-dev] building GDAL under cygwin with ODBC

Frank Warmerdam warmerdam at pobox.com
Wed Jul 15 12:12:04 EDT 2009


Neil Best wrote:
> 
> 
> Neil Best wrote:
>> Does anyone know if it's possible?
>>
>> I said:  ./configure --with-odbc=/usr/include/w32api
>>
> 
> It doesn't seem possible, so I am resigned to making it work in the FWTools
> DOS shell.  Is it possible to make a DSN-less ODBC connection?  In other
> words, can I specify my data source on the fly without having to go through
> the ODBC Administrator and setting up every single Access file as a DSN? 
> Something along the lines of:
> 
> ODBC:"Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\somepath\mydb.mdb;" 
> 
> (Lifted from
> http://www.carlprothman.net/Default.aspx?tabid=90#ODBCDriverForAccess )
> 
> Otherwise I'll have to write something in Perl using Win32::ODBC to loop
> through all of my Access files and set up a DSN for each one.

Neil,

To my surprise, this syntax does work now though it is very fragile.
For instance, I did the following successfully:

   ogrinfo "ODBC:DRIVER=Microsoft Access Driver (*.mdb);DBQ=FWTest.mdb"

The danger is that the datasource name parser is looking for commas,
and colons for the general syntax:

userid/password at dsn,tablename(geometrycolname),...:srs_tablename(sridcolumn,srtextcolumn)

So it would be easy to end up with things getting confused and things
split up wrong if the "dsn" component is not a simple token.  I'm going
to see if I can make it more bulletproof.

But you should be able to get going already.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list