Skip to Content.
Sympa Menu

freetds - RE: [freetds] problems configuring..

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ZIGLIO Frediano <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] problems configuring..
  • Date: Tue, 25 Feb 2003 16:07:49 +0100

>
> I checked this out; here is what I see:
>
> My /etc/odbcinst.ini contains, in full:
>
> [PostgreSQL]
> Description = ODBC for PostgreSQL
> Driver = /usr/lib/libodbcpsql.so
> Setup = /usr/lib/libodbcpsqlS.so
> FileUsage = 1
>
> [TDS]
> Description = v0.61
> Driver = /usr/local/lib/libtds.so
> FileUsage = 1
>

libtds.so is not the odbc driver.
odbc driver so file is called libtdsodbc.so
IMHO this is your problem...

>
> And in the directory /usr/local/lib I have the following:
>
> -rw-r--r-- 1 root root 1075500 Feb 24 09:36 libct.a
> -rwxr-xr-x 1 root root 695 Feb 24 09:36 libct.la
> lrwxrwxrwx 1 root root 12 Feb 24 09:36 libct.so ->
> libct.so.0.0
> lrwxrwxrwx 1 root root 12 Feb 24 09:36 libct.so.0 ->
> libct.so.0.0
> -rwxr-xr-x 1 root root 572950 Feb 24 09:36 libct.so.0.0
> -rw-r--r-- 1 root root 1233420 Feb 24 09:36 libsybdb.a
> -rwxr-xr-x 1 root root 716 Feb 24 09:36 libsybdb.la
> lrwxrwxrwx 1 root root 15 Feb 24 09:36 libsybdb.so ->
> libsybdb.so.1.0
> lrwxrwxrwx 1 root root 15 Feb 24 09:36
> libsybdb.so.1 ->
> libsybdb.so.1.0
> -rwxr-xr-x 1 root root 673808 Feb 24 09:36
> libsybdb.so.1.0
> -rw-r--r-- 1 root root 855988 Feb 24 09:36 libtds.a
> -rwxr-xr-x 1 root root 702 Feb 24 09:36 libtds.la
> lrwxrwxrwx 1 root root 13 Feb 24 09:36 libtds.so ->
> libtds.so.0.0
> lrwxrwxrwx 1 root root 13 Feb 24 09:36 libtds.so.0 ->
> libtds.so.0.0
> -rwxr-xr-x 1 root root 463222 Feb 24 09:36 libtds.so.0.0
>

Did you compile odbc (--with-unixodbc=/directory) ??

>
> I've triple checked my DB access.. From my Windows machine I
> can connect
> with this perl script:
>
> use DBI;
> my $dsn = "driver={SQL
> Server};Server=192.168.1.54;database=Partners;uid=testuser;pwd
> =password1;";

Connection string should be changed to

my $dsn =
"driver=TDS;Server=192.168.1.54;database=Partners;uid=testuser;pwd=password1
;TDS_Version=7.0;Port=1433";

If you want to mantain same string reconfigure freetds with
--with-tdsver=7.0 and change odbcinst.ini in such way:

[SQL Server]
Description = v0.61
Driver = /usr/local/lib/libtdsodbc.so
FileUsage = 1

> my $dbh = DBI->connect("dbi:ODBC:$dsn") or die "$DBI::errstr\n";
> $sql="SELECT company FROM contact1";
> $sth=$dbh->prepare($sql);
> $sth->execute();
> while ($hashref=$sth->fetchrow_hashref()){
> print $hashref->{'company'}."\n";
> }
> $sth->finish();
>

freddy77

=================================
"STRICTLY PERSONAL AND CONFIDENTIAL

This message may contain confidential and proprietary material for the sole
use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient please contact
the sender and delete all copies.
The contents of this message that do not relate to the official business of
our company shall be understood as neither given nor endorsed by it."

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




Archive powered by MHonArc 2.6.24.

Top of Page