Looking for suggestion as to where we might find the problem in
getting a sample script implementing db persistance working with the
above config on a windows box.

Tries to follow the docs by the following:

 -- add to httpd.conf: 
         PerlModule Apache::DBI

and:

/mod_perl/persistantdbi.pl
==========================

use DBI (); 
use Apache::DBI;
use strict;

use vars qw($dbh);
use CGI;
my $cgi=new CGI;
use CGI::Carp 'fatalsToBrowser';

print $cgi->header;
print $cgi->start_html("Persistant Test");

    use Win32::OLE::Variant;
    use Win32::OLE;
    use Win32::OLE::Const;
    use DBD::ADO;
    my $database = "db";
    my $user = "port";
    my $password = "ahem";
    my $ADO_SQL_data_source =
            "Provider=SQLOLEDB;Database=$database;Uid=$user;Pwd=$password;";

     $dbh ||= DBI->connect("dbi:ADO:$ADO_SQL_data_source"  )|| print "Error 111";

    my $sth = $dbh->prepare('select description from grade');
    $sth->execute() || print "error 555";
    my @row;
    while(@row=$sth->fetchrow) { print @row; }
    print $cgi->end_html;

Now this works perfectly (like it prints the result of the sql) on the
first web access.  However when you reload or access again from
another machine or whatever, this in the browser:

HTTP/1.1 200 OK Date: Thu, 17 Aug 2000 22:31:40 GMT Server:
Apache/1.3.12 (Win32)               
   mod_perl/1.23 Connection: close Transfer-Encoding: chunked
Content-Type: text/html;             
   charset=iso-8859-1    

and this is the error_log:

[Fri Aug 18 00:31:40 2000] nul: Win32::OLE(0.12): GetOleObject() Not a Win32::OLE 
object at C:/Perl/site/5.6.0/lib/Win32/OLE/Lite.pm line 148.
[Fri Aug 18 00:31:40 2000] nul: Win32::OLE(0.12): GetOleObject() Not a Win32::OLE 
object at C:/Perl/site/5.6.0/lib/Win32/OLE/Lite.pm line 148.
[Fri Aug 18 00:31:40 2000] [error] Can't call method "Clear" on an undefined value at 
C:/Perl/site/5.6.0/lib/DBD/ADO.pm line 47.

thanx
-- 
Eric Smith
Fruitcom.com
Landline: 00 27 21 426 5311
Mobile: 00 27 82 373 1224

Reply via email to