Hey there,
I hope this is not annoying as I've spend countless hours looking at others peoples code to get someething VERY basic to work which I've had no luck. To skip background and bullshit, see #5 below:
Background:
1) I am running strawberry perl v5.12.2 for MSWin32-x86
2) I want to do teh following use DBI;
3) recursive DOS search shows several DBI.PM installed which may or may not be found in the @INC array
C:\strawberry dir /s DBI*.pm
4) To summarize I probably have various DBI.pm floating around in
subdirectories -
When I reun this script via other programmers suggestions:
#!C:\strawberry\perl\bin\perl.exe
use Win32::OLE;
my $DBFile = qw(C:\Documents and Settings\Owner\Desktop\Drug_List.mdb); #
#Choose appropriate version of Jet for your system
my $Jet = Win32::OLE->CreateObject('DAO.DBEngine.36')
or die "Can't create Jet database engine.";
my $DB = $Jet->OpenDatabase($DBFile);
my $SQLquery = "SELECT * FROM Drug List";
$DB = $dbh->prepare($SQLquery);
my $DB->Execute($SQLquery, 128); #128=DBFailOnError
while (@row=$DB->fetchrow_array()) {
print "@row\n";}
I get the following error (less errors because I turned
off use strict; and use warnings;
"Can't call method prepare on an undefined value at accessproj.pl line 11
Can someone PLease help? I am running winxp, strawberry perl, downloaded dBI.pm not sure if @inc is finding it (I assume so),a nd just want to test to see if perl can open an access database and retrieve a simple SQL query. This would provide me great relief and joy! Thank you.
I hope this is not annoying as I've spend countless hours looking at others peoples code to get someething VERY basic to work which I've had no luck. To skip background and bullshit, see #5 below:
Background:
1) I am running strawberry perl v5.12.2 for MSWin32-x86
2) I want to do teh following use DBI;
3) recursive DOS search shows several DBI.PM installed which may or may not be found in the @INC array
C:\strawberry dir /s DBI*.pm
4) To summarize I probably have various DBI.pm floating around in
subdirectories -
When I reun this script via other programmers suggestions:
#!C:\strawberry\perl\bin\perl.exe
use Win32::OLE;
my $DBFile = qw(C:\Documents and Settings\Owner\Desktop\Drug_List.mdb); #
#Choose appropriate version of Jet for your system
my $Jet = Win32::OLE->CreateObject('DAO.DBEngine.36')
or die "Can't create Jet database engine.";
my $DB = $Jet->OpenDatabase($DBFile);
my $SQLquery = "SELECT * FROM Drug List";
$DB = $dbh->prepare($SQLquery);
my $DB->Execute($SQLquery, 128); #128=DBFailOnError
while (@row=$DB->fetchrow_array()) {
print "@row\n";}
I get the following error (less errors because I turned
off use strict; and use warnings;
"Can't call method prepare on an undefined value at accessproj.pl line 11
Can someone PLease help? I am running winxp, strawberry perl, downloaded dBI.pm not sure if @inc is finding it (I assume so),a nd just want to test to see if perl can open an access database and retrieve a simple SQL query. This would provide me great relief and joy! Thank you.