in reply to MS Access database problem

vdubjunkie:

I don't see how that program returned that error message, as the database name in the error doesn't match the one in your program. Anyway, I use the ODBC driver all the time (though never with access). I'd suggest placing curly braces around the value in the 'driver=' clause, like so:

my $driver = 'driver={Microsoft Access Driver(*.mdb)};dbq=';
Give that a shot and let's see if the error changes. If so, let me know what the new error message is...

...roboticus

Replies are listed 'Best First'.
Re^2: MS Access database problem
by vdubjunkie (Novice) on Nov 29, 2007 at 16:50 UTC
    oops, looks like my manual search/replace didn't function well. Now that error looks right :P

    So, I changed like you showed, and no dice. Same error

    Any other thoughts?

      vdubjunkie:

      OK then for the next step, let's just try to change the error message. Change the line:

      my $dbh = DBI->connect("DBI:ODBC:$dstring","","");
      to
      my $dbh = DBI->connect("DBI:ODBC:driver={SQL Server};" . "SERVER=Bobs.pancake.hut;DATABASE=flapjacks;", "account","password");
      Hopefully, instead of the error you're getting, you'll get one about not being able to connect.

      ...roboticus

        Sorry if this double posts..

        So I changed like you said, however fixing some quoting issues..

        my $dbh = DBI->connect("DBI:ODBC:driver={SQL Server};","SERVER=Bobs.pa +ncake.hut;DATABASE=flapjacks;","account","password");
        I got the following errors:
        DBI->connect using 'old-style' syntax is deprecated and will be an err +or in futu re versions at C:\temp\temp.pl line 14 install_driver(password) failed: Can't locate DBD/password.pm in @INC +(@INC cont ains: C:/Perl/site/lib C:/Perl/lib .) at (eval 4) line 3. Perhaps the DBD::password perl module hasn't been fully installed, or perhaps the capitalisation of 'password' isn't right. Available drivers: DBM, ExampleP, File, Gofer, ODBC, Proxy, SQLite, Sp +onge. at C:\temp\temp.pl line 14
        Ok, so I slightly changed the line you put down as the quoting was a bit off..

        my $dbh = DBI->connect("DBI:ODBC:driver={SQL Server};","SERVER=Bobs.pa +ncake.hut;DATABASE=flapjacks;","account","password");
        and then I got the following error:

        DBI->connect using 'old-style' syntax is deprecated and will be an err +or in futu re versions at C:\temp\temp.pl line 14 install_driver(password) failed: Can't locate DBD/password.pm in @INC +(@INC cont ains: C:/Perl/site/lib C:/Perl/lib .) at (eval 4) line 3. Perhaps the DBD::password perl module hasn't been fully installed, or perhaps the capitalisation of 'password' isn't right. Available drivers: DBM, ExampleP, File, Gofer, ODBC, Proxy, SQLite, Sp +onge. at C:\temp\temp.pl line 14