>
>
> Hi All
>
> I am running the following script. Using ODBC for the first time
>
> <snip>
>
> #!D:\Perl\bin\perl
>
> use Win32::ODBC;
> use DBI;
You should use either DBI or Win32::ODBC, but not both. You are not really
using DBI at this point -- and hence, you've posted to the wrong list.
>
> use CGI qw(:standard);
> use CGI::Carp qw(fatalsToBrowser);
>
> my $dbh = new Win32::ODBC("dBASE Files") or die Win32::ODBC::Error();
(or, if you want to use DBI (recommended), then: my $dbh =
DBI->connect("dbi:ODBC:dBASE Files", "", "", { RaiseError => 1 });
>
>
> </snip>
>
> I get the following error in the browser, when I run it on Apache web
> server.
>
>
> 911 at D:/Program Files/Apache
> Group/Apache2/cgi-bin/odbc2.cgi line 10.
>
> But when I run this code on command line - no error.
>
> I have setup a System DSN "dBASE Files" which I am using in the above
> string.
1) I suggest to not create DSNs with spaces. It may cause issues.
2) If you use DBI, you can get a good error message and turn on tracing to
get better information (DBI->trace(9, "c:/trace.txt");)
3) Ensure the user running apache has permissions to the drive/directory
that the dBASE Files points to.
4) Ensure the DSN is using UNC instead of drive letter, if the
drive/directory is located on a separate machine.
Regards,
Jeff