MSSQL::DBlib 1.009
MSSQL::Sqllib 1.008

Brief overview

Michael Peppler developped Sybperl. Christian Mallwitz of Intershop GmbH ported Sybperl 2.03 to NT (there is now a more recent NT port that comes with the regular Sybperl distribution). From their work, I created MSSQL::DBlib.

MSSQL::Sqllib is fairly generic SQL library built on top of the DBlib class, with an interface which is focused on being simple to use.

What's in this kit

The zip file includes Intel binaries for ActivePerl 5xx, 6xx and 8xx (Perl 5.005, 5.6 and 5.8). If you need a binary for ActivePerl 3xx, mail me at sommar@algonet.se.

The kit includes source files and a makefile.pl, so that you can build it from sources if you like. See Building from sources at the end of this file.

The binaries were all built on Windows XP SP1, against versions 522, 631 and 804 of ActivePerl. For the binaries for ActivePerl 6xx and ActivePerl 8xx I used the C++ compiler in Visual Studio 6 SP5. For the binary for ActivePerl 5xx, I used the C++ compiler in Visual Studio .Net. (Because the binary compiled with VC+ 6 would not run).

Prerequisites

To install the binaries this you need (if you are building from sources, see below).

How to install

Running test scripts

The MSSQL modules comes with a couple of test scripts. If you install from source code, you run the test scripts as part of the installation process, see below.

If you want to verify a binary installation, run test scripts from the command line. See tests.html for how to run the test scripts.

Small troubleshooting guide

You may get a message like this when you run a script which uses any of the MSSQL modules:
   Can't load 'f:/Perl/AS-613/site/lib/auto/MSSQL/DBlib/DBlib.dll' for module MSSQL
   ::DBlib: load_file:The specified module could not be found at f:/Perl/AS-613/lib
   /DynaLoader.pm line 200.
    at 1_dblib.t line 22
   Compilation failed in require at 1_dblib.t line 22.
   BEGIN failed--compilation aborted at 1_dblib.t line 22.

This means that one or more of the DLLs required to run DB-Library are not present. Probably you have not installed the client part of SQL Server on the machine where you get this error. Grab hold of an SQL Server CD. You only need to install client libraries.

If the above happens to you when you run the script from a web server, but it works when you run from a command prompt, then you need to install DB-Library on the web server.

Manuals

The docs subdirectory contains documentation for the two modules. There is a POD and an HTML file for each module. You may want to rebuild the HTML files, so that references to Perl elements outside MSSQL are resolved. The file DOPOD.BAT is a simple file that just builds the HTML files locally.

Sample scripts

The directory eg contains a small collection of sample scripts, some that I've inherited from the Sybperl distribution. You also find one utility that might be useful, SPTRITEST, which tests all stored procedures in a database for trivial errors. WARNING! Don't run SPTRITEST on a live database, but only on a database you can afford to waste.

Reporting bugs or problems

Please mail bug reports and suggestions to sommar@algonet.se. Try to make your reports as specific as possible. Particularly don't forget to include which versions of Perl, Windows, SQL Server etc you are using.

I usually try to respond within 24-48 hours, but if I am on holiday I am.

Building from Sources

Prerequisites

To build this you need.

How to install

Text in this type face indicates command you run from the command prompt.
  1. Extract the zip file anywhere you like.
  2. Edit DBlib/makefile.pl so that $SQLDIR points to where you include and link libraries for DB-Library are included.
  3. DBlib/makefile.pl also includes a dynamic_lib option, which I don't know whether it will work with other compilers than Visual C++. For better startup performance, you are encouraged to find the corresponding command-line option for your compiler. However, you can remove it if you don't care.
  4. Open a Command Prompt, and change directory to where you extracted the files.
  5. Perl makefile.pl.
    I suggest that you run this from the top directory.
  6. MAKE
    Or NMAKE, DMAKE or whatever your MAKE utility you use.
  7. If you want to run the test scripts, edit DBlib/t/sqllogin.pl and Sqllib/t/sqllogin.pl so that they contain a valid combination of user, password and server. They're shipped to use Windows authentication and local server. Don't forget to remove sensitive information, once the tests are OK.
  8. MAKE test
    See tests.html for notes on the tests.
  9. MAKE install
You're on the air!
Last updated 03-01-01 20:11