httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean T Allen <s...@usaherbals.com>
Subject Re: [users@httpd] Database connection problem :(
Date Fri, 17 Dec 2004 19:09:03 GMT
Sounds like some sort of permission problem with the dsn...

kaav ram wrote:

>     Hello all,
>          I am trying to write a program to connect to a
>     database(MSAccess) using CGI.
>     the program works fine if i run it in the commandline with perl (sans
>     the print statements involving html of course). But when i run it
>     from
>     the server, on explorer, it gives internal server error. the
>     error  log
>     records:
>
>     [Fri Dec 17 21:50:09 2004] [error] [client 127.0.0.1]
>     [Microsoft][ODBC
>     Driver Manager] Data source name not found and no default driver
>     specified (SQL-IM002)(DBD: db_login/SQLConnect err=-1)\r
>
>     As perl is recorgnising the DSN and connecting properly, I dont know
>     whatt the problem is?
>
>             Should I save the DB in cgi-bin or some such place?  the
>     entire
>     code i used follows, for your kind inspection.
>
>
>     #!c:/Perl/perl5/perl/bin/perl.exe
>     use DBI;
>     print header;
>     my $DSN = 'kaavya';
>         my $dbh = DBI->connect("dbi:ODBC:$DSN", '','')
>          or die "$DBI::errstr\n";
>     my $sql = " INSERT INTO table1 VALUES (4,'tt') ;";
>       $dbh->do($sql)
>          or die "Execution problem: $DBI::errstr";
>     print "<HEAD></HEAD>\n";
>     print "<body> i hope this works!</body>";
>         print "</HTML>";
>       $dbh->disconnect;
>
>
>     I would be glad if anyone could point me in the right direction. or
>     suggest some place I could find help solving this puzzling problem.
>
>     Kaavya
>
> *Yahoo! India Matrimony* 
> <http://in.rd.yahoo.com/specials/mailtg/*http://yahoo.shaadi.com/india-matrimony/>*:*

> Find your life partner online 
> <http://in.rd.yahoo.com/specials/mailtg2/*http://yahoo.shaadi.com/india-matrimony/>.

>
>


Mime
View raw message