[unixODBC-support] probelsm getting unixODBC to access an MS Access database on Linux

Martin J. Evans martin at easysoft.com
Fri Sep 10 09:00:50 BST 2004


open("/usr/lib/libmdbodbc.so.0", O_RDONLY) = 3
suggests unixODBC found the DSN, got the driver name, located the driver in
odbcinst.ini and loaded it.

open("/home/gavin/.odbc.ini", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xf6de3000
read(3, "", 4096)                       = 0
write(2, "Couldn\'t find DSN /home/gavin/.o"..., 53Couldn't find DSN 
/home/gavin/.odbc.ini in gblakesdb
) = 53

suggests mdbtools only looks for DSNs in $HOME/.odbc.ini.
Move your gblakesdb entry into $HOME/.odbc.ini and try again.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
Development



On 09-Sep-2004 Gavin Simpson wrote:
> Hi,
> 
> I have installed mdbtools, plus their ODBC driver for MS Access and have 
> configured it and unixODBC as the various instructions suggest. I am 
> having trouble connecting to the single defined system dsn. Ultimately I 
> want to connect to the mdb file from PHP but I can get isql to connect 
> yet so that can wait until the dsn is sorted.
> 
> I'm using mdbtools 0.5 rpms on Fedora Core 2.
> 
> Anyone have any idea what I'm doing wrong or how to get this working?
> 
> Thanks in advance,
> 
> Gavin
> 
> *Here is some info:*
> 
> cat /etc/odbc.ini
> [gblakesdb]
> Description = GBLakes 3.0 Microsoft Access
> Driver = MDBToolsODBC
> Database = /var/www/databases/gblakes/gblakes.mdb
> Servername = localhost
> UserName =
> Password =
> Port = 5432
> 
> cat /etc/odbcinst.ini
> [PostgreSQL]
> Description             = ODBC for PostgreSQL
> Driver          = /usr/lib/libodbcpsql.so
> Setup           = /usr/lib/libodbcpsqlS.so
> FileUsage               = 1
> 
> [MDBToolsODBC]
> Description             = MDB Tools ODBC drivers
> Driver          = /usr/lib/libmdbodbc.so.0
> Setup           =
> FileUsage               = 1
> CPTimeout               =
> CPReuse         =
> 
> *running:*
> 
> $ isql gblakesdb
> Couldn't find DSN /home/gavin/.odbc.ini in gblakesdb
> LookupDSN: LoadDSN returned FALSE[ISQL]ERROR: Could not SQLConnect
> 
> $ strace isql -v gblakesdb 2>st.log
> [08001][unixODBC]Could not find DSN in odbc.ini
> 
> *strace output:*

<snipped>




More information about the unixODBC-support mailing list