PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Ian B dot MacDonald" <imac at netstatz dot com>
Subject: DBD-Sybase + ASE Client + MSSQL
Date: Mar 2 2005 3:58AM

Hello sybperl mailing-list,

A year ago ish (ActiveState 5.6.1.635 DBI 1.37 + DBD-Sybase 1.00, ASE
12.5) I built a perl script to interface with a MSSQL 7.0 SP2 on NT4Sp6
database.  Worked great with Michael's online docs at the time, and some
help from a DBD:Sybase O'Reilly book  

I now need to reimplement on Windows 2000 + SQL 7.0 SP2.  Should be a no
brainer? Just slap on ActiveState, DBD-Sybase, DBI and off to the races.
Maybe. :)

I perform all my development on my Debian unstable box which is equiped
with DBD-Sybase 1.00-1 and DBI 1.46-6 on Perl 5.8.x.  In nifty vmware I
have my target server running SQL 7.0 SP2 and Windows 2k, and serveral
others running various combinations of AS5.6.1.631/5.8.4.810
ASE12.5/12.5.2 DBD1.00-1.04 and DBI1.37-1.46. For the life of me, my
simple test script (possibly stolen from o'reilly DBDSybase book) that
dumps the SQL table structure does not seem to want to run - except that
it works fine from my Debian command line against any MSSQL databse
(SP2-4). So I believe it should work with the right combo of AS/ASE and
DBD. 

I happen to have my original image with NT4, AS5.6, DBI1.37, DBD1.00,
ASE12.5 still kicking around.  It has the most success conencting to my
new W2K SQL7 box, and outputs the first few lines of the table dump, and
subsequently hangs.  Output Below:

**OUTPUT BEGIN**
 
C:\WINNT\Profiles\Administrator\Desktop>perl dump_w2ks.pl
Connected using SA
Selected name from master.dbo.systemdatabase
About to Stuff Names into Array
About to finish statement
About to go through array
---master---
        MSreplication_options
                optname [sysname(128)]
                value [bit(1)]
                major_version [int(10)]
                minor_version [int(10)]
                revision [int(10)]
                install_failures [int(10)]

**OUTPUT END**

On my other test images, I have

On W2K/AS5.8/DBD1.04_10/ASE12.5.2(peppler.org), 
W2K/AS5.6/DBD1.02/ASE12.5(crazyinsomniac.perlmonk.org) and
W2K/AS5.8/DBD1.04/ASE12.5(esofmasic.com)

(I think I have also tried the first with ASE12.5)

I have in my C:\Sybase\ini\sql.ini
[win2k-server]
QUERY=NLWNSCK,192.168.79.13,1433
or 
[win2k-server]
QUERY=NLWNSCK,localhost,1433

..the latter on the one box hosting the database itself. Connectivity
and name resolution (via lmhosts locally on each machine) is not an
issue.

They all act the same. I receive no output..just does nothing and
requires CTRL-C. I even took one permutation and tried MSSQL7 SP2, SP3
and SP4 - No change, although my goal is for a system running SP2.

So, there must be a way for me to find/turn on some more debug output
and help myself, but I just do not know how to do it. It never gets to
the second line of real code, which is a print.

** Code Snippet Begin **
$dbh = DBI->connect('dbi:Sybase:server=win2k-server','sa','masterkey',
{PrintError => 1} );
print "Connected using SA $DBI::errstr\n";
** Code Snippet End **

What I am not sure of is:
Does ASE Client 12.5.2 work just like 12.5?  It doesn't seem to create the
sql.ini file in C:\sybase\ini which has me worried. So I've been
sticking to just 12.5 in my latest tests.

Any help on where I may be going wrong here or someone who can say
ASE Client + W2K cannot talk to MSSQL7 anylonger, or how I can approach debugging
myself further would be great.  I'm no Perl whiz, so humble me with
criticism if there are some basic things I should do.

I have also attached my messy test script for the curious.

cheers,
Ian.

-- 
Ian B. MacDonald