I want to execute Perl script through VB6.0 . Please help .

I also want to access the database from Perl Script .

Recommended Answers

All 6 Replies

This is a VB.NET forum, not VB6.0 nor Perl.

You appear to have two Perl related questions, so I'm moving this thread to the Perl forum.

to run the perl script from VB.NET, you need to shell to the system. I guess this works:

dim wsh
set wsh = createobject("WScript.Shell")
wsh.run "c:\perl\perl.exe somefile.pl", 0, 0

as for accessing the database with perl, look up the DBI Perl Module.

While connecting to the msaccess database using perl . i'm gettting this error " cannot locate object method "CONNECT" via package"

this is my code

I'm unable to execute it Getting error o line no 3 .. please help..

my $db_file   = 'E:\db\Foqa3.mdb';
my $dbh = DBI->connect('DBI:ADO:Provider=Microsoft.Jet.OLEDB.4.0;Data Source='.$db_file) or die $DBI::errstr;
 $sth = $dbh->prepare($sqlstatement);
$sth->execute || 
       die "Could not execute SQL statement ... maybe invalid?";
 #output database results
 while (@row=$sth->fetchrow_array)
     print "@row\n" 

Installed activeperl 5.10.0. build 1002

Installed DBI 1.602

Then i read that DBD::ODBC came with activeperl 5 so i went into ppm, looked at all packages.. found dbd::odbc, right clicked and said install. it seemed to install but now i can't find it anymore on ethier the all packages or the installed packages.

when i try and run my perl script i get the following error:

install_driver(ODBC) failed: Can't locate DBD/ODBC.pm in @INC (@INC contains: C: /Perl/site/lib C:/Perl/lib .) at (eval 5) line 3. Perhaps the DBD::ODBC perl module hasn't been fully installed, or perhaps the capitalisation of 'ODBC' isn't right. Available drivers: DBM, ExampleP, File, Gofer, Proxy, SQLite, Sponge.


Applicable code:




use DBI;
use File::Copy;

# Assign Path and File Names

$outfilepath= '"S:\Reports\"';
$outfile= "RepInv.pdf";
$DBappfilepath = '"C:\\Program Files\\Microsoft Office\\Office12\\msaccess.exe"' ;
$DBfilepath = '"D:\\Data\\Databases\\Weekly.accdb"';
$Macro = "\/X InvRptMacro";
$ExecuteString = "$DBappfilepath $DBfilepath $Macro";

# Establish Date Prefix for Output Filename

$day = (localtime) 3;
$day = substr ("0$day",length ("0$day")-2,2);
$month = (localtime) 4 + 1;
$month = substr ("0$month",length ("0$month")-2,2);
$year = (localtime) 5 + 1900;
$filename = "$year$month$day";

#open connection to Access database

$dbh = DBI->connect('dbi:ODBC:Mapics - MM CAD');


the above example was with shell...what if i am using windows and running perl script throgh command prompt?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.