is that a user dsn or a system dsn?

you'll need to check what username your cgi script runs as, and whether or not that 
account has permissions to access the database, and whether or not that account can 
access the DSN. Most web servers start cgi scripts as the user 'nobody' or 'www' or 
'www-data' - it should be in the server configuration somewhere.

I suggest you use a dsn-less connection: merely connect with my $db=new 
Win32::ODBC("DBQ=C:\\path\\to\\database.mdb; Driver=Microsoft Access Driver (*.mdb)");

the (*.mdb) isn't a typo - it is actually part of the driver name...

if your database is password protected, you'll need to supply pwd= or password= (can't 
remember which it is for access)



On Sat, 26 Jun 2004 18:04:04 +0530, Venkata. Sitaram <[EMAIL PROTECTED]> wrote:


Hi,

When I trying to access the Ms aceess Database through CGI script, I am getting
the following error.

Error connecting to MQIS Error: [911] [] "[Microsoft][ODBC Driver Manager] Data
source name not found and no default driver specified"

Below I am including my Code also. Can any one please suggest on this..?

#################

use Win32::ODBC;


$DSN = "MQIS"; if (!($db = new Win32::ODBC($DSN,"sa",""))){ print "Error connecting to $DSN\n"; print "Error: " . Win32::ODBC::Error() . "\n"; exit; }


$SqlStatement = "SELECT * FROM order_items"; if ($db->Sql($SqlStatement)){ print "SQL failed.\n"; print "Error: " . $db->Error() . "\n"; $db->Close(); exit; } while($db->FetchRow()){ undef %Data; %Data = $db->DataHash();

foreach $key (keys %Data) {
print "$Data{$key}\t";
}
}

##################################

Thanks and Regards,

Sitaram Pamarthi.

Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!

Get Ready Cash instantly. In 72 hrs !

_______________________________________________

Perl-Win32-Users  mailing  list

[EMAIL PROTECTED]

To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to