in reply to Need help with MS Access with Perl.......

While I don't have the solution to your problem, I take the opportunity to comment on some strange things you use in your code:
$dbh = CreateObject OLE "ADODB.Connection" or die "Can't create connec +tion to DataBase: $!" unless $dbh;
In this statement you create the OLE object, or if that fails, you die with a message UNLESS it did not fail...Read that again... You want to remove the unless $dbh

Another thing is this:
$rs = $dbh->Execute( $sqlstatement ) or die print ( "Can't adminmail d +atabase problemdsds Perl says $!, DBI says ",$dbh::errstr,"");
Why do you do a die print? All other die statements you use have just the text as a parameter, and you now you're printing it explicitly. Besides that I don't know if that would work (it may, it's perl after all), you could just remove the print and the parens (), and it should all work.

Last question is why you are not using DBI? If you change to another ISP that uses MS SQL Server, or MySQL, you would have to change your code again. With DBI (and more specifically, using the ODBC or ADO DBD-driver) you would have the ability to write portable code. It would prevent you from rewriting your code over and over again.

Just my $0.02

--HolyGrail

Replies are listed 'Best First'.
Re: Re: Need help with MS Access with Perl.......
by Anonymous Monk on Jun 28, 2001 at 13:15 UTC
    In this statement you create the OLE object, or if that fails, you die with a message UNLESS it did not fail...Read that again... You want to remove the unless $dbh

    No! He creates a database connection (or dies), unless he has one already. Thats a fully valid caching technique.
      Still kind of strange when you created $dbh in the statement before this one with my $dbh;...

      --HolyGrail
        So he has perhaps the two lines swapped ;-)(sub and my)?