ODCB won't conect when Perl script run from Web server

ODCB won't conect when Perl script run from Web server

Post by Soren Kuul » Mon, 17 Sep 2001 04:40:59



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 :
  #!/usr/local/bin/perl
  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
  Soren

 
 
 

1. Perl scripts won\t connect thru ODBC when run by 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 :
  #!/usr/local/bin/perl
  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
  Soren

2. Creating Temp Tables

3. Scripts written in SQL 7.0 won't run on SQL 6.5

4. Can it be done with SQL server ?

5. ActiveX script won't run

6. ADB-94, International Conference on Applications of Databases

7. page won't run FMPro script

8. Discussion on PMML

9. Package with cube processing task won't run from Web

10. DTS Packages as SQL Server Agent Jobs Won't Run

11. SQL Server 2000 SETUPSQL Won't Run

12. SQL Server Desktop edition on Win98 (won't run)

13. SQL Server won't Stay Running