Re: [gnome-db] an application using libgda2
- From: Marco Milanesi <kpanic muppetslab org>
- To: gnome-db-list gnome org
- Subject: Re: [gnome-db] an application using libgda2
- Date: Fri, 9 May 2003 20:46:00 +0200
> Try to put into the connection string something like HOST=localhost:
>
> "DATABASE=PUB;HOST=localhost"
>
> and check the permissions to conect to the database of the postgresql
> configuration files.
hi, sorry to bring up this thread, but I have problems again with the
PostgreSQL Provider.
and sorry for the long post :)
I'm using:
ii postgresql 7.3.2r1-5 Object-relational SQL database, descended fr
ii libgda2-1 0.11.0-2 GNU Data Access library for GNOME2
my ~/.libgda/config is:
<?xml version="1.0"?>
<libgda-config>
<section path="/apps/libgda/Datasources/foo">
<entry name="Provider" type="string" value="PostgreSQL"/>
<entry name="DSN" type="string"
value="USER=kpanic;PASSWORD=kpanic;PORT=5342;HOST=localhost;HOSTADDR=127.0.0.1;DATABASE=pub"/>
<entry name="Description" type="string" value="DBPUB"/>
<entry name="Username" type="string" value="kpanic"/>
<entry name="Password" type="string" value="kpanic"/>
</section>
</libgda-config>
and the code that I'm using is:
#include <libgda/libgda.h>
#include <stdio.h>
void save_ds(void)
{
gda_config_save_data_source ("foo", "PostgreSQL",
"USER=kpanic;PASSWORD=kpanic;PORT=5342;HOST=localhost;HOSTADDR=127.0.0.1;DATABASE=pub",
"DBPUB",
"kpanic",
"kpanic");
}
int main(int argc, char **argv)
{
GdaClient *client;
GdaConnection *connection;
gda_init("TestGDA", "0.1", argc, argv);
save_ds();
client = gda_client_new ();
if (!client) {
fprintf(stderr, "client error\n");
exit(EXIT_FAILURE);
}
g_print ("CONNECTING\n");
connection = gda_client_open_connection(client, "foo", "kpanic",
"kpanic", 0);
if (!GDA_IS_CONNECTION(connection)) {
fprintf(stderr, "Can't connect via gda\n");
exit(EXIT_FAILURE);
}
g_print ("CONNECTED\n");
gda_client_close_all_connections (client);
return 0;
}
well, I've tried connecting with pphp and all seems ok, am I missing
something?
I've tried various combination, with password, without password, with
HOST, HOSTADDRESS etc, using as a separator ',' or ';'
now I'm really stumped
ciao,
Marco
--
.oO :: kpanic / muppetslab :: Oo.
.oO :: online on #muppetslab at irc.freenode.net :: Oo.
.oO :: http://www.muppetslab.org | http://ada2.unipv.it/~kpanic :: Oo.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]