in reply to DBI vs. Win32::ODBC

According to this book, which IMHO is an excellent guide for programming Perl using databases, Win32::ODBC tries to be an interface for ODBC, while DBI tries to be an abstraction layer on top of any database.

That said, I've never encountered real performance gains in one over the other. DBI is excellent when you need the ability to connect your software to a different database... With DBI this is often as simple as changing the connection string (and perhaps some simple changes to the SQL statements).

In my experience, using DBI has been simpler than Win32::ODBC, and the applications can be developed and run in multiple platforms. This of course would be irrelevant if your target platform is always going to be WinNT.

Replies are listed 'Best First'.
Re: Re: DBI vs. Win32::ODBC
by rrwo (Friar) on Oct 25, 2001 at 03:07 UTC

    To re-iterate the point: DBI lets you use a multitude of Database interfaces (ODBC, ADO, or an interface written for a specific database such as Oracle or Sybase or even CSV files).

    Additional Note I forgot to put in my original reaply: The reason I point this out is that sometimes ODBC works better, sometimes ADO works better, and sometimes the native driver works best. (I've had many problems trying to call Oracle functions using ODBC, although they work fine using the Oracle driver or ssometimes ADO.)

    Also: Win32::ODBC hasn't been updated in a few years (the version with ActivePerl is from 1997).