Accessing Pervasive.SQL With Perl

Page Last Modified: 06/10/15

Home Links ODBC (DBI) Contact

Win32::ODBC (and Win32::DBIODBC)

Win32::ODBC was created by Dave Roth (based on code by Dan DeMaggio) and is a "low-level" Perl wrapper to the Microsoft ODBC data access mechanism, hence it is only available on Windows platforms.


History (22/02/10)

When creating this site I had forgotten that my first successful attempts at accessing Pervasive.SQL with Perl were with Win32::ODBC rather than DBI, which I tried first but had problems with (what those problems were have long since departed my memory). While archiving some old sample code and projects from a former job into CVS recently, I uncovered some of this Win32::ODBC work.

I used the module around 2001-2003 before moving away from Perl for several years. Since returning in 2007 I have used DBI.


Around the time I used Win32::ODBC, development had apparently stopped. The "Programming the Perl DBI" book has a section released just before I started discusses Win32::ODBC and describes the key differences between it and DBI (+ DBD::ODBC). Since then DBI (and DBD::ODBC) have undergone many enhancements, while Win32::ODBC has remained largely unchanged with some small updates recently. It is available through CPAN and ActivePerl.

Many of the resource URLs for this module appear to have disappeared but there are still people using it as evident from recent postings to mailing lists and forums.

Assuming the module still works for me (and it should because ActiveState still maintain the PPM version) I will add some code samples shortly...

...and it does!

  1. Checking for available datasources.
  2. Fetching data.

DBI also comes with a Win32::ODBC emulation layer, called Win32::DBIODBC, built-in. This allows you to keep your old code without needing to install Win32::ODBC. The latest documentation (for DBI 1.634 when I updated this page) does warn, howver, that the module is "very basic very alpha quality" and error handling is "virtually non-existent".

  1. Fetching data example using Win32::DBIODBC.

Home Links ODBC (DBI) Contact

All content on this site is copyright
Neil Hughes 2010 - 2018