I am having a problem moving a perl script I am using on the command line
into apache due to an error connecting to MS SQL.
My Environment:
Windows 2K professional
SQL Server 2000
Apache 2
Perl 5.6.1
DBD::ODBC v 0.28
Here is the problem:
When run on the command line I am able to connect to the DB with no problem
using the following code:
my $db_handle = DBI->connect( 'DBI:ODBC:local_db', �username�, 'password',
{ RaiseError => 1 } );
All is well except that I�m running on windows and using MS SQL�. ;)
The problem arises when I use this same code in a CGI running in apache I
receive the following error.
[Microsoft][ODBC Driver Manager] Data source name not found and
no default driver specified (SQL-IM002)(DBD: db_login/SQLConnect err=-1)
I realize that apache probably needs more information in order to connect to
the DB, so I have tried several ways of defining the DSN. One of them
follows:
my $db_handle = DBI->connect(
'DBI:ODBC:local_db@servername:1433', �username�, 'password', { RaiseError =>
1 } );
No matter how I attempt to define the connection, it always gives me the
same error:
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified (SQL-IM002)(DBD: db_login/SQLConnect err=-1)
I know I�m missing something simple, but I�m at a loss. How do I get a CGI
that works on the command line to connect to a DB when running in apache?
Thanks in advance!
Paul
Paul Russell
[EMAIL PROTECTED]