Click here to get back home

DBD:Excel on unix machine

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
DBD:Excel on unix machine yan.vulich 03-09-2006
Get Chitika Premium
Posted by yan.vulich on March 9, 2006, 11:18 am
Please log in for more thread options


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;
$hSt = $hDb->prepare("CREATE TABLE a (id INTEGER, name CHAR(10))")
or die "Cannot prepare: " . $hDb->errstr();
$hSt->execute() or die "Cannot execute: " . $hSt->errstr();
$hSt->finish();
$hDb->disconnect();

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
Thanks in advance


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

Similar ThreadsPosted
Want to generate Excel charts inside Excel files by Perl CGI generating Excel files using WriteExcel.pm December 8, 2008, 3:46 pm
filecopy from remote machine to local machine February 7, 2006, 8:50 am
Need help with a simple UNIX sockets server based on IO::Socket::UNIX April 14, 2005, 3:02 am
DBD::Pg on machine without Postgres November 3, 2004, 11:16 am
How to know what perl modules on my machine October 8, 2004, 4:04 pm
how to execute command on remote machine September 21, 2005, 12:40 am
installing www::mechanize on a windows98 machine November 13, 2005, 8:31 pm
Namespace for Z-machine parse/translate module July 29, 2004, 10:02 am
GD incorrectly renders Arabic on Win32 machine March 6, 2005, 9:28 pm
Trouble installing storable 2.13 with perl 5.8.0 on redhat 9 machine December 10, 2004, 12:06 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap