I have some more query towards the end of this message, in response to Jeff.

[EMAIL PROTECTED] wrote:

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.


I would use DBI, I was just trying Win32::ODBC - that's where I stopped last time.



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 });


I will try this out on monday.



</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




I will create DSN w/o spaces.
The situation is that the dBase files are at d:\DBTEMP
and apache at d:\Program Files\Apache Group\apache2

With this cause a problem - by saying apache should be able to access, do you mean it has to be in apache's root directory?
Thanks for the input


Regards
Aman

Reply via email to