RE: DBI::ODBC in a web application

RE: DBI::ODBC in a web application

am 23.03.2006 15:37:36 von Philip.Garrett

> -----Original Message-----
> From: Robert Hicks [mailto:sigzero@earthlink.net]=20
> Sent: Thursday, March 23, 2006 7:13 AM
> To: dbi-users@perl.org
> Subject: DBD::ODBC in a web application
>=20
> If I create a test script to connect to a Microsoft Access database
> that is on a network (UNC) drive I can connect to it fine.
>
> If I try to do the same thing from a web application running under
> Apache I get the following error:
>
> Error executing run mode 'display_task_page': Can't connect to data
> source driver=3DMicrosoft Access Driver =
(*.mdb);dbq=3D\\Resolver\Users\BH-
> icks\Public\Project_task_report_2003.mde, no database driver specified
> and DBI_DSN env var not set at
> C:/Perl/site/lib/CGI/Application/Plugin/DBH.pm line 42 at
> D:/Projects/www/DEV/exp/index.cgi line 14
>
> I have tried mapping that UNC path to a local drive letter as well
> with the same error.
>
> I am not sure if the problem resides with Apache, the modules I am
> using for the web application of DBD::ODBC itself.
>
> Any pointers?

It looks like the "dbi:ODBC:your_datasource_name" parameter isn't making
it into the DBI->connect call (although some part of it is).

If you enable DBI->trace(1), the call to DBI->connect will go into your
Apache error_log, so you can see exactly what is getting passed to the
connect method.

Philip