Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Re: connecting Perl with MS SQL Server on NT using ODBC

by x-c-ute-o-ner (Initiate)
on Nov 17, 2002 at 07:27 UTC ( #213531=note: print w/replies, xml ) Need Help??

in reply to Re: connecting Perl with MS SQL Server on NT using ODBC
in thread connecting Perl with MS SQL Server on NT using ODBC

Excuse me... I tried many time using your sample code for ODBC, but there is an error everytime i tried to use this code:
#!/usr/bin/perl -w use strict; use DBI; # Module connection for ODBC # Set up variables for the connection my $server_name = "shadow"; my $server_ip = ""; my $database_name = "Smart Response System"; my $database_user = "cs59173"; my $database_pass = "5055"; my $DSN = "driver={SQL Server};server=$server_name;tcpip=$server_ip;da +tabase=$database_name;uid=$database_user;pwd=$database_pass"; my $DBH = DBI->connect("DBI:ODBC:$DSN") or die "Couldn't open database +: $DBI::errstr\n";
The error message is:

DBI->connect(driver={SQL Server};server=shadow;tcpip=;database=Smart Response System;uid=cs59173;pwd=5055) failed: MicrosoftODBC Driver Manager Invalid string or buffer length (SQL-S1090)(DBD: db_login/SQLConnect err=-1) at c:\Perl\SRS\ line 13

FIY, i have tried also sequence of examples by other monks, but also failed. Could you please help tracing the problems? Thanx a lot...

Replies are listed 'Best First'.
Re: Re: Re: connecting Perl with MS SQL Server on NT using ODBC
by Mission (Hermit) on Nov 19, 2002 at 15:43 UTC

    Sorry that I don't see an obvious error in this code. I do have a couple of questions that might help your debugging. Just look through the list and make sure you have the correct information.

    • The conection is expecting a MS SQL server connection, is that your correct database type?
    • Did you try to re-install the (module) and (driver) on the server and on your testing machine using PPM?
    • Are you certain of the IP?
    • Did you double check your Username, PWD?
    • Is the database name correct? (BTW: None of my databases have spaces in their names. That doesn't mean that it won't work like that, but I've not tried that before. You may want to rename you database to something without spaces.)

    I don't see an error, and those questions are just to get you thinking on the debugging process. I hope you have good luck on this problem. If there is any progress, or different problem, please make sure you post the final solution, or additional problems.


    - Mission

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://213531]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2016-10-25 07:23 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (315 votes). Check out past polls.