Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

perl DBI/DBD connection problem

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Database Connectivity Forum >> perl DBI/DBD connection problem Page: [1]
Login
Message << Older Topic   Newer Topic >>
perl DBI/DBD connection problem - Jul. 9, '04, 1:03:02 PM   
galen

 

Posts: 11
Joined: Jul. 6, '04,
Status: offline
I installed unixODBC, freeTDS and am attempting to connect to a SQL Server database using perl DBI and DBD::ODBC. Get the following error when I try to connect:

DBI connect('ETALK','etalk_ro',...) failed: [unixODBC][Driver Manager]Can't ini
iate unicode conversion (SQL-IM003)
[unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libtdsodbc.so' : /usr/
ocal/lib/libiconv.so: cannot open shared object file: No such file or directory
(SQL-01000)(DBD: db_login/SQLConnect err=-1) at .//db2.pl line 23
[unixODBC][Driver Manager]Can't initiate unicode conversion (SQL-IM003)
[unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libtdsodbc.so' : /usr/
ocal/lib/libiconv.so: cannot open shared object file: No such file or directory
(SQL-01000)(DBD: db_login/SQLConnect err=-1)

=====================================================

/usr/local/lib/libiconv.so does not exist.

Here is the perl code:


#!/usr/local/bin/perl
use strict;
use DBI;

my @driver_names = DBI->available_drivers;
foreach (@driver_names)
{
printf "Driver = $_\n";
}

my @datasources = DBI->data_sources("ODBC");
foreach (@datasources)
{
print "Datasource = $_\n";
}

my $dbh = DBI->connect("DBI:ODBC:ETALK", "etalk_ro", "xxxxxxx")
or die "$DBI::errstr\n";

#end perl code

Thanks for any help.
Galen
Post #: 1
RE: perl DBI/DBD connection problem - Jul. 11, '04, 1:45:21 PM   
galen

 

Posts: 11
Joined: Jul. 6, '04,
Status: offline
Sorry ...
Noticed that libiconv is one of the tools available for download here.
Did that, and now I can connect.

(in reply to galen)
Post #: 2
RE: perl DBI/DBD connection problem - Jul. 12, '04, 3:01:13 PM   
Rodney

 

Posts: 3695
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
I'll update the unixobdc package to have that as a dependency.

(in reply to galen)
Post #: 3
RE: perl DBI/DBD connection problem - Jul. 21, '04, 3:09:34 PM   
larry

 

Posts: 2
Joined: Jul. 21, '04,
Status: offline
Hi, I was doing a google search and found this thread
which seems to have the same problem I am having
in some form. I installed DBI and DBD::ODBC from CPAN
on linux. We have an ODBC driver on the system because
we can use it through a similiar interface as psql that
we have. I assume I am using the driver manager that came
with DBD:ODBC.

Here's my program and error. The error is from the statement.

use DBD::ODBC


#!/usr/bin/perl



use lib "/home/ljg/myperl/lib/site_perl";

use DBD::ODBC;
use DBI;

my $dbh = DBI->connect("dbi:odbc:mydb", "lguild", "xx9");


my $sth = $dbh->prepare("SELECT id, name from megaliths");

exit;



Can't load '/home/ljg/myperl/lib/site_perl/5.6.1/i386-linux/auto/DBD/ODBC/ODBC.s
o' for module DBD::ODBC: libodbc.so.1: cannot open shared object file: No such f
ile or directory at /usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
at ./try.pl line 7
Compilation failed in require at ./try.pl line 7.
BEGIN failed--compilation aborted at ./try.pl line 7.

(in reply to Rodney)
Post #: 4
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> Database Connectivity Forum >> perl DBI/DBD connection problem Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.047