I would second what Curtis said. Avoid Win32::ODBC entirely.

Not just because of the features, but because it's also not going to be 
portable anyway beyond simple CGI on WinNT. Every few months someone on the 
ActiveState PerlEx (loosely known as the NT equivalent to mod_perl) mailing 
list posts

"Win32::ODBC mysteriously crashes on me"...

And perennially, the response is "Don't use Win32::ODBC".

The reason is that Win32::ODBC is not thread safe. DBD::ODBC is. NT is a 
multi-threaded OS so if you start using a shared interpreter model for 
speed like PerlEx, you'll run into a lot of problems. And even if you don't 
now, you might later and then you will run into problems.

Here is a snippet from PerlEx tech support (Murray Nesbitt) on the issue

"Win32::ODBC is notoriously unreliable when used with PerlEx, as this
extension is not thread-safe.  You will likely have much better luck with
DBD::ODBC which is thread-safe, portable, and more actively maintained
than Win32::ODBC. More details and a list of known thread-safe extensions 
is at:

http://www.activestate.com/ppm/threads.htm";

As an aside, these issues are also similar to what will become issues with 
Apache 2.0. Although I am not the biggest fan of PerlEx (eg no formal 
support for taintmode), I think ActiveState has done mod_perl 2.0 a huge 
advance service by basically culling out modules that won't work with a 
multi-threaded Perl interpreter pool since this is exactly how PerlEx works 
today.

Later,
     Gunther

PS I notice the URL from Murray's msg no longer works and I can't seem to 
find a similar reference on ActiveState to a list of threadsafe modules 
although it might now be embedded in the docs to Win32 Perl.

At 12:38 AM 10/10/2001, Curtis Poe wrote:
>--- [EMAIL PROTECTED] wrote:
> > I'm successfully connecting to a Pervasive 7 database with my PERL program
> > when running from the command line.
> >
> > I try to run the program in my webbrowser and I get the following error.
> >
> > Error connecting to MO Error: [802] [] "[Pervasive Software][ODBC
> > Interface][Pervasive Software SQL Engine]General error."
> >
> > (MO is the name of my system DSN)
> >
> > any ideas how to fix this so it runs on the web server properly
>
>While this is not the answer you seek, have you considered switching to 
>DBI with the DBD::ODBC
>driver?  This would give you several advantages:
>
>1.  It's portable.
>
>2.  Placeholders are supported.  That, combined with DBD::OBDC's separate 
>prepare and execute
>statements could let you do this:
>
>     my $sql = 'SELECT firstName, lastName FROM table WHERE uid=?';
>     my $sth = $dbh->prepare( $sql );
>     foreach my $uid ( @uid ) {
>         push @names, $sth->fetchrow_arrayref( $uid );
>     }
>
>Since the statement is already prepared, this is much faster than Win32::ODBC.
>
>3.  Notice I didn't use any error handling in step 2?  (ignoring for the 
>moment that I could have
>had an invalid $uid) DBI allows me to set RaiseError automatically, thus 
>catching errors for me.
>For large applications, this is critical.
>
>4.  Win32::OBDC has no bind parameters.  As a result, you can't specify a 
>BLOB, for example.
>Forget about using binary data.
>
>5.  More programmers know DBI and thus can offer you better support.
>
>6.  DBI has the DBI->trace method, which is a godsend for debugging.
>
>Cheers,
>Curtis "Ovid" Poe
>
>=====
>Senior Programmer
>Onsite! Technology (http://www.onsitetech.com/)
>"Ovid" on http://www.perlmonks.org/
>
>__________________________________________________
>Do You Yahoo!?
>NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
>http://geocities.yahoo.com/ps/info1
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

__________________________________________________
Gunther Birznieks ([EMAIL PROTECTED])
eXtropia - The Open Web Technology Company
http://www.eXtropia.com/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to