DBD:Sybase connect failure

"Goldstein, Ian" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <7D4C1602CAF88540A33E0FAE4B5C392404DB7F1C@MSBLDA0026I001.cibna.msds.wachovia.net>
Hi

I successfully compiled and tested connectivity to my sql sever using
tsql.
I am now want to utilize DBI.

I downloaded DBD-Sybase-1.08  and installed the DBD driver according to
the docs with a couple of changes.

I set SYBASE to /tmp/freetds  ( my install ).
I ran perl Makefile.PL 


I am using perl-5.8.8 and sunstudio11 and freetds.0.82

During the make  I received the following errors:

				cc -c  -I/tmp/freetds/include -DNO_BLK=1
-I/apps/perl-5.8.8/lib/site_perl/5.8.8/sun4-solaris-thread-multi/auto/DB
I  -D_REENTRANT -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O    -DVERSION=\"1.08\"  -DXS_VERSION=\"1.08\"
-KPIC "-I/apps/perl-5.8.8/lib/5.8.8/sun4-solaris-thread-multi/CORE"
dbdimp.c
				"dbdimp.c", line 800: undefined symbol:
BLK_VERSION_150
				"dbdimp.c", line 804: undefined symbol:
BLK_VERSION_125
				"dbdimp.c", line 808: undefined symbol:
BLK_VERSION_120
				"dbdimp.c", line 4695: warning:
statement not reached
				"dbdimp.c", line 4740: warning:
statement not reached
				"dbdimp.c", line 4784: warning:
statement not reached


I found a couple of references on the net and applied the following to
dbdimp.c

				bash-2.05$ diff dbdimp.c dbdimp.c.save 
				735,740d734
				< #undef CS_VERSION_150
				< #undef CS_VERSION_125
				< #undef CS_VERSION_120
				< #undef CS_DATE_TYPE
				< #undef CS_BIGINT_TYPE

That seems to have made it compile fine.  Now the problem.

As I mentioned,  I can access my sql server through tsql.  However, I
cannot access through DBI.

Here is my freetds.conf file:

[sqlserver]
        host=162.111.17.91
        port = 12000
        Trace = yes
        tds version = 8.0


Here is the perl code:  with SYBASE set to /tmp/freetds

#!/apps/perl-5.8.8/bin/perl
use DBI;

my $db="testdb";
my $user="xyz\\abcdg";
my $pass="Apr-2008";
my $dbh =
DBI->connect("DBI:Sybase:server=sqlserver;database=$db,$user,$pass" ) ||
die "Database connection not made: $DBI::errstr\n";


When I run the script, I get the following error:

DBI
connect('server=sqlserver;database=FACSOLAPCore,cibna\x582406,Apr-2008',
'',...) failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY =
(78) NUMBER = (34)
Server sqlserver, database 
Message String: Adaptive Server connection failed
 at ./xx.pl line 24
Database connection not made: OpenClient message: LAYER = (0) ORIGIN =
(0) SEVERITY = (78) NUMBER = (34)
Server sqlserver, database 
Message String: Adaptive Server connection failed


And the tds log file logfile contains the following:

14:50:04.030794 22468 (log.c:190):Starting log file for FreeTDS 0.82
        on 2008-06-02 14:50:04 with debug flags 0xffff.
14:50:04.038761 22468 (iconv.c:197):names for ISO-8859-1: ISO8859-1
14:50:04.039209 22468 (iconv.c:197):names for UTF-8: UTF-8
14:50:04.039620 22468 (iconv.c:197):names for UCS-2LE: UCS-2LE
14:50:04.040035 22468 (iconv.c:197):names for UCS-2BE: UCS-2BE
14:50:04.040596 22468 (iconv.c:363):iconv to convert client-side data to
the "ISO-8859-1" character set
14:50:04.043472 22468 (iconv.c:516):tds_iconv_info_init: converting
"ISO-8859-1"->"UCS-2LE"
14:50:04.044354 22468 (iconv.c:516):tds_iconv_info_init: converting
"ISO-8859-1"->"UCS-2LE"
14:50:04.044926 22468 (net.c:210):Connecting to 162.111.17.91 port 12000
(TDS version 7.0)
14:50:04.046152 22468 (net.c:264):tds_open_socket: connect(2) returned
"Operation now in progress"
14:50:04.050268 22468 (net.c:303):tds_open_socket() succeeded
14:50:04.050732 22468 (util.c:162):Changed query state from DEAD to IDLE
14:50:04.051372 22468 (util.c:162):Changed query state from IDLE to DEAD
14:50:04.051828 22468 (util.c:334):tdserror(164b98, 2e6be8, 20002, 0)
14:50:04.052275 22468 (ct.c:334):ct_con_props() action = CS_GET property
= 9108
14:50:04.052716 22468 (ct.c:486):fetching userdata 1c5180
14:50:04.053311 22468 (util.c:368):tdserror: client library returned
TDS_INT_CANCEL(2)
14:50:04.053751 22468 (util.c:389):tdserror: returning TDS_INT_CANCEL(2)
14:50:04.054184 22468 (mem.c:563):tds_free_all_results()
14:50:04.055815 22468 (ct.c:630):leaving ct_connect() returning 0
14:50:04.056294 22468 (ct.c:1865):ct_con_drop()


It looks like it connects me but  I cannot seem to log on.  Can somebody
help.

Thanks,
Ian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.