perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Landwehr <andre.landw...@gmx.net>
Subject DBIx::Database problem
Date Mon, 16 Sep 2002 14:40:17 GMT
Hi,

I have a quite simple page which I can't get to run:
[- 
	use DBIx::Database;
	use DBIx::Recordset;

	$db=DBIx::Database -> new ({'!DataSource'   => 'DBI:mysql:dbname=memphis_www',
	                        '!Username'     => 'myuser',
	                        '!Password'     => 'mypwd',
	                        '!SaveAs'       => 'memphis_www',
	                        '!Reconnect'    => 1
	                       });

	*set = DBIx::Recordset -> Search ({'!Datasource'  => 'memphis_www',
	                                   '!Table'       => 'user'
	                                  });
	print OUT "first name: $set[0]{lastname}<br>";

-]
The error is:
 [8742]ERR: 24: Error in Perl code: Can't connect( ), no database driver specified and DBI_DSN
env var not set at /usr/share/perl5/DBIx/Recordset.pm line 199

The same thing happens when I use $db instead of 'memphis_www'
in the Search statement.

The whole thing works ok when I supply all parameters directly to
DBIx::Recordset and do not use DBIx::Database at all, but this is not
really an option since I want to store database logon information in a
central location and not on each and every page again.

I use DBIx::Recordset 0.24 (from the Debian package), Embperl is 2.0b8.

Andre

--
"The inside of a computer is as dumb as hell, but it goes like mad!"
(Physicist Richard Feynman)


Mime
View raw message