|
Posted by xhoster on March 9, 2006, 1:58 pm
Please log in for more thread options
yan.vulich@gmail.com wrote:
> Hi, folks.
> Is anyone know if its possible to use Excel DBD on unix machine,
> I tried to do it, after installation of all packges i ran the most
> popular sctipt in the net:
> use DBI;
> $hDb = DBI->connect("DBI:Excel:file=test.xls")
> or die "Cannot connect: " . $DBI::errstr;
...
>
> but always receive an error:
> DBI connect('file=test.xls','',...) failed: (no error string) at
> test.pl line 2
> Cannot connect: at test.pl line 2.
>
> PLEASE HELP
Does your xls file exist?
I get that error when the xls file I am trying to open does not exist.
To hunt down the problem, I've tried to make the DBD::Excel module give
better error messages by making this change:
#3.check file and parse it
$DBD::Excel::errstr="No file given", return undef unless($hDb->);
my $oExcel = new Spreadsheet::ParseExcel::SaveParser;
my $oBook = $oExcel->Parse($hDb->, $rhAttr->);
$DBD::Excel::errstr="Can't seem to get a book from your excel file",
return undef unless defined $oBook;
Since I've never dealt with DBD internals before, this very well might not
be the right way to do this--I can only claim it was right enough to help
me track this specific problem down.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
|