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. | [reply] |
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).
| [reply] |
I've worked with DBI and ODBC
DBI is not an standard module, and you can work with ODBC without installing any module.
ODBC is faster making a connection (with SQL Server) than DBI.
In DBI is easy to get the ID of the record that you insert with 'insert into...', it's only necessary one sentence; in ODBC I have to execute two sentences
Try a supersearch for more information
Hope this helps
Hopes | [reply] |
Of course Win32::ODBC is only standard with Activestate.
DBI, while not core either, does run on multiple
platforms and doesn't lock you in to running on Wintendo.
If you write to DBI you can fairly easily (for some
values of easily) move to a different platform without
rewriting.
| [reply] |