develooper Front page | perl.dbi.users | Postings from August 2006

Problem getting Perl - SQL Server connect working - syntax error?

Thread Previous | Thread Next
From:
Powers.Chris
Date:
August 15, 2006 05:59
Subject:
Problem getting Perl - SQL Server connect working - syntax error?
Hello,
 
I'm trying to figure out what syntax issue I have with my Perl code.  I
am new at this, so it's probably something basic - simple syntax, but I
don't see it and have looked thru some examples I've found online and
still no luck.
 
It's a Windows Server, SQL Server db, if it makes a difference, I'm
running the code on one server and the db is on another.
 
I've got DBD-ODBC and DBI loaded thru PPM, running ActiveState Perl
5.8.8 build 817.
 
use strict;
use warnings;
use DBI;
use DBD::ODBC;
use Getopt::Std;
use Data::Dumper;
 
my $db_host = "10.15.158.124";
my $db_name = "dbname";
my $db_user = "id";
my $db_pass = "idpassword";
 
my $dbh =
DBI->connect("DBI:ODBC:dbname=$db_name:host=$db_host;port=3306",
$db_user, $db_pass, { RaiseError => 1 });
 
>perl record_last_used_rule_db.pl
DBI connect('dbname=dbname:host=10.15.158.124;port=3306','id',...)
failed: [Microsoft][ODBC Driver Manager]
Data source name not found and no default driver specified
(SQL-IM002)(DBD: db_login/SQLConnect err=-1) at
record_last_used_rule_db.pl line 34
 
This came originally from something for mysql, I think all I've changed
was updated it to have ODBC, but perhaps there's some other option SQL
Server / ODBC needs?  

Thanks for the help!

-Chris 
  
  
  
LEGAL DISCLAIMER 
The information transmitted is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error please contact the sender and delete the material from any computer. 
  
Seeing Beyond Money is a service mark of SunTrust Banks, Inc. 
[ST:XCL] 
 
 
 
 


Thread Previous | Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About