On 27-Feb-2004 [EMAIL PROTECTED] wrote:
> Hello,
> 
> I have been trying to extract data from a access.mdb file using perl5,
> DBI-1.40, DBD-ODBC-1.07, unixODBC-2.2.7, and libmdbodbc.xx driver from
> mdbtools.  I have seen many sources and posts proclaiming the possibility
> to avoid needing to define DSN's by connecting similar to the following:
> 
> my $DSN = 'driver=Microsoft Access Driver
> (*.mdb);dbq=\\\\cheese\\g$\\perltest.mdb'; my $dbh =
> DBI->connect("dbi:ODBC:$DSN", '','') or die "$DBI::errstr\n";
> 
> 
> But I have tried everything I could imagine and looked everywhere as well
> for some documentation to tell me why I continue to get the DBI::errstr:
> 
> [unixODBC]Could not find DSN in connect string (SQL-08001)(DBD:
> db_login/SQLConnect error=-1)
> 
> I have recompiled and installed everything.  The mdbodbc driver is
> "...installed" according to the odbcinst script output.  I have tried all
> sorts of ENV variables.  And yes I have read every README and INSTALL I
> coud find.  It looks like the driver manager is finding the driver ok, but
> doesn't like the connect string.  Anyone you can help out would be doing
> me and it looks like a bunch of other folks a big favor.
> 
> Thank You,
> 
> R.H.

Although your error makes it look like it is from unixODBC I seriously doubt it
is because the text "Could not find DSN in connect string" does not exist in
unixODBC - rightly, because there is no such ODBC error.

The error is obviously coming from mdbtools driver which it would appear from
the above:

o fails to put itself in the error string - i.e. missing "[mdbtools driver]" or
  whatever the driver is called.

o fails to support DRIVER=.

You can probably prove this by turning tracing on in unixODBC and seeing the
SQLConnect call is being passed to the driver.

Of possible interest to Jeff Urlwin may be the:

> db_login/SQLConnect error=-1)

as I would assume DBD::ODBC should be calling SQLDriverConnect when the
connection string contains a driver=. Perhaps this is because you are using
"driver=" instead of "DRIVER=" (the ODBC spec is a bit hazy on this but always
uses "DRIVER".

If you get no further with mdbtools and still need to access a mdb from UNIX
let me know as I can suggest other commercial ways.

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

Reply via email to