costas has asked for the wisdom of the Perl Monks concerning the following question:

I am running perl on Windows 2000 using IIS 5 and MS SQL 2000.

I am trying to connect to Microsoft SQL using DBD::Sybase and specifically do not want to use ODBC.

I have DBI succesfully installed along with several drivers. I have installed DBD::SYbase and there appears to be no errors on installation. However when I run my generic dbd driver check I get the following error:

Driver: ExampleP Driver: ODBC Driver: Proxy Driver: Sybase Content-type: text/html Software error: install_driver(Sybase) failed: Can't load 'E:/Perl/site/lib/auto/DBD/S +ybase/Sybase.dll' for module DBD::Sybase: load_file:The specified mod +ule could not be found at E:/Perl/lib/DynaLoader.pm line 206. Compilation failed in require at (eval 3) line 3. Perhaps a required shared library or dll isn't installed where expecte +d For help, please send mail to this site's webmaster, giving this error + message and the time and date of the error. [Tue Apr 2 14:31:12 2002 +] E:\Inetpub\cgi-bin\test.pl: install_driver(Sybase) failed: Can't lo +ad 'E:/Perl/site/lib/auto/DBD/Sybase/Sybase.dll' for module DBD::Syba +se: load_file:The specified module could not be found at E:/Perl/lib/ +DynaLoader.pm line 206. [Tue Apr 2 14:31:12 2002] E:\Inetpub\cgi-bin\ +test.pl: Compilation failed in require at (eval 3) line 3. [Tue Apr 2 + 14:31:12 2002] E:\Inetpub\cgi-bin\test.pl: Perhaps a required shared + library or dll isn't installed where expected
Sybase.dll does exist however and in the specified directory.

For anyone who wishes to see my dbd test code:
my @drivers = DBI->available_drivers(); foreach my $driver (@drivers) { print "Driver: $driver<br>"; if ($driver ne "Proxy" && $driver ne "Multiplex" && $driver ne "Ex +ampleP") ##DBD:Proxy and DBD::Multiplex have problem with datasources { my @datasources = DBI->data_sources($driver); foreach my $datasource (@datasources) { print "\tData Source is $datasource<br>"; } } print "\n"; }
I appreciate any help
Thankyou

Replies are listed 'Best First'.
Re: Problems with DBD::Sybase
by Biker (Priest) on Apr 02, 2002 at 14:40 UTC

    It looks like you haven't installed the Sybase Open Client. (Which is not Perl, but binary libraries provided by Sybase.)


    Everything went worng, just as foreseen.

      Biker,

      Either that or in the *nix world I would say if that's not the case then your LD_LIBRARY_PATH (or ld.so.conf file) does not contain the path to the Open Client libs (what's the equivalent in MS world?)

      -derby

Re: Problems with DBD::Sybase
by mpeppler (Vicar) on Apr 02, 2002 at 15:14 UTC
    Biker is almost certainly right. While ActiveState distributes a binary DBD::Sybase package this will only work if you have installed Sybase's OpenClient libraries.

    I believe that you can download an eval of Sybase 12.5 from www.sybase.com which should include the client libraries. That should at least let you verify that the binaries work.

    However Sybase's OpenClient does not work with MS-SQL 2k (the last version it worked with was MS-SQL 7, and that required a patch from MS).

    So I suspect that you may need to review your options, and that ODBC may be your best bet at this point (unless you want to try to get freetds to work on Win32...)

    Michael

Fighting the Tide by Avoiding ODBC Use with MS SQL 2000 {Re: Problems with DBD::Sybase}
by dave_aiello (Pilgrim) on Apr 03, 2002 at 12:36 UTC
    I've been using MS SQL Server since version 6.5. Over time, it has become obvious to me that Microsoft isn't committed to interoperability with Sybase at a middleware level. Even if it is possible to use DBD::Sybase to work with the version of MS SQL Server that you use, I would not do it. The reasons are:
    1. Major third party vendors treat Sybase and Microsoft SQL Server as separate products for the purpose of integration. Some are charging separate license fees for each product, but nearly all make clear distinction at the driver/middleware level.
    2. When Microsoft deals with vulnerabilities in its infrastructure products, it patches reference configurations first. If there was a vulnerability at the middleware level, I know they would fix ODBC, ADO, and OLE-DB first.
    3. Anytime I have to deal with a Microsoft component in a Perl application and there is more than one way to implement the solution, I try to determine which implementation is least likely to be broken by future Microsoft architecture changes.
    YMMV, but that's why I use DBD::ODBC instead of DBD::Sybase for MS SQL Server.

    Dave Aiello
    Chatham Township Data Corporation

      Over time, it has become obvious to me that Microsoft isn't committed to interoperability with Sybase at a middleware level.

      It isn't at all suprising that MS SQL has been gradually diverging from Sybase, the only surprise (to me) is that it's taken this long. When MS secured rights to the codebase and forked, they probably kept TDS (the underlying wire protocol) in the interest of getting a product out quickly. That meant that Sybase client libraries could access the early versions of SQL Server. MS probably left good enough alone while focusing on reworking the guts of the database, and are only now getting around to introducing incompatabilities innovations that require new client libraries.

      In environments where ODBC isn't available, or if Sybase drivers aren't available, consider using freetds.