How to connect Perl-CGI with MS SQL Server



Hi.

With Microsoft-IIS/6.0 + CGI/1.1, I want to connect with my 'MS
SQL Server'.

My connection data are:
- user: john
- DSN: domain.com.john
- pass: xxxx
- server: db.domain.com

I'm trying with:

--------------------
use DBI;
print "Content-type: text/html\n\n";
$dbusername = 'john';
$dbpassword = 'xxxx';
$server = 'db.domain.com';
$database = 'domain.com.john';
$dbh = DBI->connect("DBI:ODBC:driver={SQL
Server};Server=$server;Database=$database;UID=$dbusername;PWD=$dbpassword")
|| die "$Error_Message $DBI::errstr";
print "OK\n";
----------------------

But it doesn't work. I've got DBI installed cause this piece of code
does work:
-----
use DBI;
print "Content-type: text/html\n\n";
print "Hello world!\n";
--------

Any suggestion? Thank you very much.

.



Relevant Pages

  • Re: perl DBI on windows 64
    ... statements in the code to indicate progress of execution or whatever. ... Start your reading with the PrintError, RaiseError and HandleError attributes in DBI. ... once you've looked at the 20SqlServer example in DBD::ODBC you will see it uses HandleError. ... There is one annoyance with SQL server: You can't have more than one "active" statement, i.e. a statement that is executing but not yet finished, per connection. ...
    (perl.dbi.users)
  • How to connect IIS-CGI with MS SQL Server
    ... SQL Server'. ... - user: john ... - DSN: domain.com.john ... I've got DBI installed cause this piece of code ...
    (perl.dbi.users)
  • RE: perl DBI on windows 64
    ... And please do an FAQ entry for ODBC on windows ... Ramakrishna Raju ... perl DBI on windows 64 ... There is one annoyance with SQL server: You can't have more than one ...
    (perl.dbi.users)
  • RE: perl DBI on windows 64
    ... Ramakrishna Raju ... perl DBI on windows 64 ... Start your reading with the PrintError, RaiseError and HandleError ... There is one annoyance with SQL server: You can't have more than one ...
    (perl.dbi.users)
  • RE: perl DBI on windows 64
    ... statements in the code to indicate progress of execution or whatever. ... Use the RaiseError DBI attribute, ... There is one annoyance with SQL server: You can't have more than one ... This is a limitation of the SQL server ...
    (perl.dbi.users)