http://qs1969.pair.com?node_id=800701


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

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
  • Comment on Re^2: What is the best Perl library to use to connect and access MSSQL2008 Database from winXP PC?
  • Select or Download Code

Replies are listed 'Best First'.
Re^3: 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 13:53 UTC

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