How to connect Perl-CGI with MS SQL Server

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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: Error during SQL Server restore fails to propagate back to DBI client on Windows
    ... Error during SQL Server restore fails to propagate back to DBI client on Windows ... Here is the code for the error handler and set ... 'Processed x pages for database ....' ...
    (perl.dbi.users)
  • Re: Error during SQL Server restore fails to propagate back to DBI client on Windows
    ... Error during SQL Server restore fails to propagate back to DBI client on Windows ... the error handler is not ...
    (perl.dbi.users)
  • 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)