CGI and Perl

Open Database Connectivity (ODBC)

Microsoft's Open Database Connectivity API attempts to define a standard SQL syntax common to all database engines. The standard is based on the SQL-Access group's CLI, which has been adopted as an international standard. Microsoft has developed a call-level interface based directly on the SQL CLI. ODBC will make the development of generic, scalable client applications such as CGI/Perl5 interfaces less difficult once drivers and interfaces are more universally available.

ODBC is a component of Microsoft's Windows Open Services Architecture (WOSA). Applications can call a generic API, which is routed to the appropriate database-specific driver.

Database vendors are currently adopting ODBC as the native CLI for their database engines. ODBC drivers are currently being included in most commercial database packages. An ODBC driver manager is included in current releases of Sun's Solaris OS. ODBC is quickly becoming the standard. ODBC does not replace DBI, however. Currently, DBI's DBM modules provide access to the differing proprietary APIs implemented by the different database vendors. The DBI module itself provides a Perl5 object oriented interface to the database through the DBM modules. A Perl interface is still necessary to the ODBC API. Tim Bruce, the author of DBI, is currently rewriting DBI to fully support ODBC. The new DBI will include a new low-level ODBC API interface, along with high-level methods similar to the current DBI interface. The latest information on the development of DBI can be found at

  http://www.hermetica.com/technologia/DBI/

There is currently a Perl5 ODBC module for the 32-bit Windows architectures, including Windows 95 and Windows NT for Intel and DEC Alpha. The module is currently being ported to Macintosh and various flavors of UNIX and should be available on these platforms by the time you read this. The module is called Win32::ODBC and is being written by Dave Roth. Dave's Win32 ODBC.pm module is based on the original ODBC.PM code written by Dan DeMaggio.

Win32::ODBC may be obtained from the following URL:

  http://www.perl.com/CPAN/authors/Dave_Roth/

Currently, in order to use this module, you must be running on some 32-bit Windows architecture such as NT 3.51, 4.0, or Windows 95. You must install version 3.0 or greater of Microsoft's ODBC interface drivers and have Win32 Perl installed and working. The latest version of the ODBC drivers can be obtained directly from Microsoft at the following URL:

  http://www.microsoft.com/kb/softlib/mslfiles/WX1220.EXE

Win32::ODBC is currently not compatible with the DBI interface specification. From a Perl interface perspective, the syntax of its interface is different, but the idea is the same: You interface the database through the Win32::ODBC module from your Perl code. I will not go into great detail about the Win32::ODBC module, as it is currently available only on the Windows platform. Questions about the module are addressed on a FAQ located at the following URL:

  http://WWW.ROTH.NET/ODBC/ODBCFAQ.HTM
by BrainBellupdated
Advertisement: