Gmane
Gravatar
From: Mateusz Loskot <mateusz <at> loskot.net>
Subject: DSN-less connection not supported?
Newsgroups: gmane.comp.db.mdb-tools.devel
Date: 2006-05-23 20:52:22 GMT (3 years, 6 weeks, 1 day, 5 hours and 5 minutes ago)
Hi,

Today, I did small tests with unixODBC / MDB Tools and I see that this
tandem does not support DSN-less connections.
Am I right?

I tried to connect using ODBC and libmdbodbc drivers using following
connection string:

"Driver={Microsoft Access Driver (*.mdb)};Dbq=//path/to/file.mdb;"

My odbcinst.ini file includes properly defined driver:

mloskot:/etc$ cat odbcinst.ini
[Microsoft Access Driver (*.mdb)]
Description = MDB Tools ODBC drivers
Driver     = /usr/local/lib/libmdbodbc.so.0
Setup      =
FileUsage  = 2
CPTimeout  =
CPReuse    =

AFAIK FileUsage=2 means that the drivers should treat the file as a
whole database but not as a single table.
I tried to use FileUsage = 1 too, no difference.

I'm getting following error message:

[unixODBC]Could not find DSN in connect string

I digged into MDB Tools sources and I revealed that this message comes
from MDN Tools. Next, I found that the SQLDriverConnect function
searches connection string for 'DSN' token.
It seems quite strange, because, as I read in ODBC docs in the MSDN,
DSN-less connection string is also valid.

I could not find any useful information in unixODBC or MDB Tools docs
and mailing lists archives.

Could anyone confirm if my assumptions are correct and how to handle
DSN-less connection?

Cheers
-- 
Mateusz Łoskot
http://mateusz.loskot.net

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642