I have two computers one a Windows XP computer and the other a Windows
2003 server. I am trying to write a script that will connect to the MS
SQL DB on the Windows 2003 server but I am having problems running it on
the Windows XP computer. It works find on the Windows 2003 computer. The
error I get on the XP computer is this:
install_driver(ODBC) failed: Can't locate DBD/ODBC.pm in @INC (@INC
contains: C:/Perl/lib C:/Perl/site/lib .) at (eval 4) 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, Proxy, Sponge. at I:\Final Fantasy Site Stuff\image.pl line 7
This is my perl code:
#!user/local/bin/perl -w
use strict;
use DBI;
use GD;
my ($dir_path, @images, $image, $srcimage, $myobject, $width, $height,
$subset, $alt,
$sth, $dbh, $table);
$dbh = DBI -> connect ('dbi:ODBC:images', 'uid', 'pass') or die "Could
not open the database: $DBI::errstr;";
$dir_path = 'I:/Final Fantasy Site Stuff/FFXI images/';
$subset = 'elvaan';
$table = 'ffxi';
$alt = '';
opendir(DIR, "$dir_path/$subset");
@images = grep {/\.jpg$|\.gif$/} readdir(DIR);
closedir(DIR);
foreach $image (@images){
if ($dir_path/$image =~ /.gif$/i) {$srcimage = GD::Image ->
newFromGif($myobject);}
if ($dir_path/$image =~ /.jpg$/i) {$srcimage = GD::Image ->
newFromJpeg($myobject);}
($width, $height) = $srcimage -> getBounds();
$sth = $dbh -> prepare (qq~insert into $table (image, subset,
height, width, alt) values ($image, $subset, $height, $width, $alt)~) or
die "Could not prepare statement: $DBI::errstr";
$sth -> execute() or die "Could not execute SQL statment:
$DBI::errstr";}
I tryed reading though the info at http://dbi.perl.org/docs/ to see if
anything was there that could help me but all the links timeout on me. I
have tryed reinstalling the DBI module on my XP computer but still get
the error. Can anyone help me fix this?
Thank you,
Matt Verstraete