perl DBI/DBD connection problem (Full Version)

All Forums >> [SFU / Interix / SUA Technology] >> Database Connectivity Forum



Message


galen -> perl DBI/DBD connection problem (Jul. 9, '04, 1:03:02 PM)

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




galen -> RE: perl DBI/DBD connection problem (Jul. 11, '04, 1:45:21 PM)

Sorry ...
Noticed that libiconv is one of the tools available for download here.
Did that, and now I can connect.




Rodney -> RE: perl DBI/DBD connection problem (Jul. 12, '04, 3:01:13 PM)

I'll update the unixobdc package to have that as a dependency.




larry -> RE: perl DBI/DBD connection problem (Jul. 21, '04, 3:09:34 PM)

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.




Page: [1]



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.016