I'm working on a Solaris box, trying to connect to a remote SQL Server 7 running on a WinNT box.

I've installed the following on my Solaris box:

No errors during install. I am able to use the 'tsql' tool found in the bin dir of freeTDS to connect to my remote MS SQL Sever.

However, I can't seem to get DBD::Sybase to work. I've gotten a number of software error messages to display, when I try using the following CGI code:

#!/usr/local/bin/perl # use DBI; my $DB_Server = "DBServer"; my $DB_User = "gues"; my $DB_Pass = "test"; print "DB_Server:[$DB_Server] DB_User:[$DB_User] DB_Pass:[$DB_Pass]"; BEGIN { $ENV{SYBASE} = '/usr/local/freetds/'; } my $dbh = DBI->connect("dbi:Sybase:server=$DB_Server", $DB_User, $DB_P +ass, {PrintError => 0}); die "Unable for connect to server $DBI::errstr" unless $dbh; my $rc; my $sth; $sth = $dbh->prepare("select \@\@servername"); if($sth->execute) { while(@dat = $sth->fetchrow) { print "@dat\n"; } } $dbh->disconnect();

The most recent error message was:
DBD::Sybase initialisation failed: Had to create DBD::Sybase::dr::imp_data_size unexpectedly at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 713. (in cleanup) dbih_getcom handle DBI::dr=HASH(0xa34fc8) is not a DBI handle (has no magic) at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 713. (in cleanup) dbih_getcom handle DBI::dr=HASH(0xa34fc8) is not a DBI handle (has no magic) at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 537. at /var/apache/htdocs/test.cgi line 14

Do I have an error with DBD::Sybase? Should I try an earlier version? Could there be a missing link? or ENV setting? Any thoughts? Feedback? Assistance?

Thanks!


In reply to DBD::Sybase Woes by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.