[gnome-db] please help connecting to databse



Hello,

I am not sure what I am doing wrong, but I am trying to connect to a PostgreSQL
database. I issue the following:

gchar *provider = "PostgreSQL";
gchar *cnc_string = "HOST=localhost;PORT=5432;DATABASE=joedb;USER=joedoe";

connection = gda_client_open_connection_from_string(client,
    provider, cnc_string, (GdaConnectionOptions) 0);

gchar *query = "INSERT INTO JPeople (jperson) VALUES ('Jane Dane')";

 command = gda_command_new (query,
                                   GDA_COMMAND_TYPE_SQL,
                                   GDA_COMMAND_OPTION_STOP_ON_ERRORS);

CRITICAL **: file gda-connection.c: line 754
(gda_connection_execute_command): assertion GDA_IS_CONNECTION (cnc)'
failed

also tried:

gda_connection_execute_non_query(cnc, command, NULL);

and got:

CRITICAL **: file gda-connection.c: line 843
(gda_connection_execute_non_query): assertion `GDA_IS_CONNECTION
(cnc)' failed

So where am I going wrong??

Thanks,

Neil



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]