Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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 = "10.207.130.8:8080"; 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=10.207.130.8;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\sql.pl 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...


Comment on Re: Re: connecting Perl with MS SQL Server on NT using ODBC
Download Code
Re: Re: Re: connecting Perl with MS SQL Server on NT using ODBC
by Mission (Hermit) on Nov 19, 2002 at 15:43 UTC
    x-c-ute-o-ner,

    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 DBI.pm (module) and DBD-ODBC.pm (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.

    Thanks,


    - Mission

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (11)
As of 2014-07-30 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls