Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: What is the best Perl library to use to connect and access MSSQL2008 Database from winXP PC?

by mje (Curate)
on Oct 12, 2009 at 12:04 UTC ( [id://800686]=note: print w/replies, xml ) Need Help??


in reply to What is the best Perl library to use to connect and access MSSQL2008 Database from winXP PC?

I would say DBI and DBD::ODBC but I am the current maintainer of DBD::ODBC. You can use those modules on Windows and so long as you can get hold of a SQL Server ODBC driver or native client driver (both available from MS) you should have no problems.

  • Comment on Re: What is the best Perl library to use to connect and access MSSQL2008 Database from winXP PC?

Replies are listed 'Best First'.
Re^2: What is the best Perl library to use to connect and access MSSQL2008 Database from winXP PC?
by blackadder (Hermit) on Oct 12, 2009 at 13:00 UTC
    I am the current maintainer of DBD::ODBC

    WOW, thank heavens for that :-)

    Ok, I wonder if you can help me please (this may seem very simple but I am having kittens already)

    I have this script
    #! c:/perl/bin/perl.exe # # # # # use strict; use DBI; use DBD::ODBC; use DBD::ADO; use Win32::OLE; use Win32::ODBC; #use Win32::SqlServer; my $server = "ABCB00062\\Dev"; my $dbusername = "uk_ggg\\xyz12345"; my $dbpassword = '7seven7'; my $database = 'ukdevxxxx'; my $Error_Message = "\nThere Was A Problem Connecting To The Database\ +n"; my $dbh; #Database Handler #$dbh = DBI->connect("DBI:ODBC:driver={SQL Server};Server=$server;Data +base=$database;UID=$dbusername;PWD=$dbpassword") || die "$Error_Mess +age $DBI::errstr"; $dbh = DBI->connect("DBI:ODBC:dsnname;Server=$server;Database=$databas +e;UID=$dbusername;PWD=$dbpassword")
    But when I run it i get the following error
    U:\Doccuments\Scripts\Start>db2.pl DBI connect('dsnname;Server=ABCB00062\Dev;Database=ukdevxxxx;UID=uk_gg +g\\xyz12345; PWD=7seven7','',...) failed: [Microsoft][ODBC Driver Manager] Data sou +rce name not found and no default driver specified (SQL-IM002) at U:\Doccu +ments\Scri pts\Start\db2.pl line 32
    I thought I had all the requirements in place! Would it be possible for you please to advise me on what I need to do? Thanks in advance

    Blackadder

      Try "DRIVER=" instead of "driver=" - this attribute is case sensitive in ODBC.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-19 12:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found