Can not get DBI to work on a windows XP machine

Can not get DBI to work on a windows XP machine

am 02.09.2005 22:24:43 von matt

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

Re: Can not get DBI to work on a windows XP machine

am 03.09.2005 01:27:47 von matt

Sorry, I new I was forgetting to tell the usegroup something but I could
not figure it out at the time. I am indeed using ActiveState Perl,
version 5.8 in fact. I just used PPM to install the DBD::ODBC drive and
now no longer get that error. Thank you for your help.

CAMPBELL, BRIAN D (BRIAN) wrote:

>You are are missing the DBD driver for ODBC.
>
>What's missing from your message is what Perl you are using.
>I'll presume that it is ActiveState Perl.
>I'll also presume that you used the PPM tool to install DBI from an ActiveState repository.
>If true, the solution is to use PPM to install DBD::ODBC.
>
>I've installed DBD::ODBC on an XP and have successfully accessed an MSDE server.
>(MSDE is the free "mini-me" version of the MS SQL server.)
>
>
>-----Original Message-----
>From: Matt [mailto:matt@ffinfo.com]
>Sent: Friday, September 02, 2005 1:25 PM
>To: dbi-users@perl.org
>Subject: Can not get DBI to work on a windows XP machine
>
>
>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
>
>
>