DBD:DBI won\t connect to ODBC db when script run from web server 
Author Message
 DBD:DBI won\t connect to ODBC db when script run from web server

Can anyone help me out on this one ?

I have a Perl script that connects to an Access file (built in server of
Win2000 Prof.) through ODBC and DBD/DBI.
The problem is, whenever I run the script from the command line or I connect
to another database (mysql) everything is OK, but when the script is run as
CGI by my web server and tries to connect via O DBC, it won't ! I get an
error message meaning something like"
  [Microsoft][ODBC driver manager can't find database name and no defailt
driver has been defined (SQL-IM002)(DBD: db_login/SQLConnect err=-1) at
C:\Inetpub\Scripts\addressbook3.cgi line 33. "

  The script looks like :
  use strict;
  use CGI;
  use DBI;
  my $dbh;
  my $dsn = "dbi:ODBC:adresser";
  my $user = 'something';
  my $pass = 'something';
  eval {
    $dbh = DBI->connect($dsn, $user, $pass);
    debug("dsn: $dsn", "user: $user", "pass: $pass");
    die $DBI::errstr unless $dbh;
    $dbh->{RaiseError} = 1;

  and the $dbi is still null after DBI->connect, so the program dies.

  Anybody has a clue what I have forgotten ?
  Thank you

Thu, 04 Mar 2004 03:42:29 GMT  
 [ 1 post ] 

 Relevant Pages 

1. DBD::mysql can't connect to DB server

2. DBI/DBD/Oracle connect won't work (ORA-12154)

3. UnixODBC - DBD::ODBC not connecting when run from browser

4. paging db results w/DBD::ODBC to Web Client

5. Software Configuration for DBI and DBD to connect informix server 7.2

6. MS Access, Linux, DBI, DBD::ODBC, Easysoft's ODBC-ODBC Bridge

7. Unix web server to MS Access on NT using DBD::ODBC

8. DBI, DBD:ODBC error with MS SQL Server 6.5

9. perl script for calling a java program,running the script through cgi of the web server

10. perl dbi / dbd::odbc script causes perl to crash w/ access violation:

11. Testing Perl scripts on local Win mach to host on Unix Web Server


Powered by phpBB® Forum Software