thanks david for your help I tried with ./bin/appl.pl , query works, and I get data, but sometime I've got this error, I re try and it's ok { "exception" : "Warning caught during route execution: Use of uninitialized value $driver in hash element at /usr/local/share/perl5/Dancer/Plugin/Database.pm line 188.\n", "error" : "Warning caught during route execution: Use of uninitialized value $driver in hash element at /usr/local/share/perl5/Dancer/Plugin/Database.pm line 188.\n" } or this error [Mon Nov 11 21:39:34 2013] [error] [client 192.168.0.19] DBD::Proxy::db connected failed: Can't store CODE items at /usr/local/lib64/perl5/Storable.pm line 339, at /usr/local/share/perl5/RPC/PlServer/Comm.pm line 91, referer: http://m.maison/ Le 11/11/2013 18:18, David Precious a écrit :
On Fri, 08 Nov 2013 23:28:03 +0100 Hugues <hugues@max4mail.com> wrote:
Hello I use my DBD::Proxy to connect my program to ODBC Access Database. with:
my $dsn = "DBI:Proxy:hostname=$IP;port=$PORT;dsn=DBI:ODBC:$ODBC"; my $dbh = DBI->connect($dsn, "", "") || die "Erreur de connexion à la base"; $dbh->{AutoCommit} = 1; $dbh->{RaiseError} = 1;
I would like to transpose this same connection using Dancer, in config.yml, but I do not arrive to pass good settings. login and password are empty
plugins: Database: connections: accesssav: driver: "Proxy:hostname=192.168.0.19;port=2000;dsn=DBI:ODBC:accesssav" database: 'accesssav' You have a pre-crafted DSN, so you want to just use Dancer::Plugin::Database's "dsn" config option, like so:
plugins: Database: connections: accessav: dsn: "DBI:Proxy:hostname=...."
That should get it working for you.