Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by screamingeagle (Curate)
on Jul 01, 2002 at 22:37 UTC ( #178716=note: print w/ replies, xml ) Need Help??


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

if you're running the script on unix and trying to connect to an NT-based SQL Server, you could try and use the FreeTDS library...
a) in the FreeTDS "interfaces" file, configure the connection to the SQL Server like this :

myserver query tcp tds4.2 10.0.2.1 1433
b) in your Perl script, include code which goes something like this :
$ENV{'SYBASE'} = "/freetds" unless $ENV{'SYBASE'}; my $dbh; $dbh = DBI->connect("dbi:Sybase:server=myserver",userid,password);

hth


Comment on Re: connecting Perl with MS SQL Server on NT using ODBC
Select or Download Code
Re^2: connecting Perl with MS SQL Server on NT using ODBC
by Secalles (Initiate) on Dec 29, 2011 at 16:30 UTC
    Hellow monks

    i'm getting a similar problem with SQL Server ( I'm on windows )

    use DBI; my $user = "rodrigo"; my $pass = "123456"; my $server = "localhost\\WHATSUP:3477"; my $database_name = "equip"; my $DSN = "driver={SQL Server};server=$server;database=$database_name; +uid=$user;pwd=$pass"; my $DBH = DBI->connect("DBI:ODBC:$DSN") or die "Couldn't open database +: $DBI::errstr\n";
    But i'm getting the following error:
    DBI connect('driver={SQL Server};server=localhost\WHATSUP:3477;databas +e=equip;uid=rodrigo;pwd=123456','',...) failed: [Microsoft][ODBC SQL +Server Driver][DBNETLIB]Invalid connection. (SQL-08001) [st ate was 08001 now 01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (ParseConn +ectParams()). (SQL-01000) at C :\fsecali\connectDB.pl line 9 Couldn't open database: [Microsoft][ODBC SQL Server Driver][DBNETLIB]I +nvalid connection. (SQL-08001) [state was 08001 now 01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (ParseConn +ectParams()). (SQL-01000)
    I have no idea what should i do. Thanks in advanced
      try
      my $server = "localhost\\WHATSUP;tcpip=3477";
      poj
        I still get an error
        DBI connect('driver={SQL Server};server=localhost\WHATSUP;tcpip=3477;d +atabase=equip;uid=rodrigo;pwd= 123456','',...) failed: [Microsoft][ODBC SQL Server Driver][DBNETLIB]S +QL Server does not exist or access denied. (SQL-08001) [state was 08001 now 01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect() +). (SQL-01000) [state was 0100 0 now 01S00] [Microsoft][ODBC SQL Server Driver]Invalid connection string attribute + (SQL-01S00) at C:\fsecali\con nectDB.pl line 9 Couldn't open database: [Microsoft][ODBC SQL Server Driver][DBNETLIB]S +QL Server does not exist or ac cess denied. (SQL-08001) [state was 08001 now 01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect() +). (SQL-01000) [state was 0100 0 now 01S00] [Microsoft][ODBC SQL Server Driver]Invalid connection string attribute + (SQL-01S00)
        Thanks

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2014-07-13 18:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (251 votes), past polls