[gnome-db] Error on using connection



Hi guys,

As I already told Rodrigo, this code of mine (and actually also gASQL
but not gnomedb-fe) is failing to use the GdaConnection I have opened.

** This is the connection stuff: **
#include <gnome-db.h>
#include <inh_product_search.h>

int
main (int argc, char *argv[])
{
  GtkWidget *inh_product_search;
  GdaConnection *connection;

  gnome_db_init ("InhTest", "0.0.1", argc, argv);

  connection = gda_connection_new_from_dsn ("inhunmi",
					    "cleber",
					    "mypass");
  if (connection) {

    inh_product_search = inh_product_search_new (connection,
						 "");
    gtk_widget_show_all (inh_product_search);
  }

  gtk_main ();
  
  return 0;
}

** This is where a actually use the connection  **
static void product_list_update (GtkWidget *widget,
				 gpointer data)
{
  InhProductSearch *inh_product_search;
  GdaRecordset *result_set;
  GdaCommand *command;
  gchar *query;
  gchar *text;
  gulong count;
  gulong flags;

  inh_product_search = INH_PRODUCT_SEARCH (data);

  text = gtk_entry_get_text (GTK_ENTRY
(inh_product_search->search_text_entry));

  query = g_strdup_printf (QUERY_PRODUCT_GRID,
			   text);

  
  command = gda_command_new ();
  gda_command_set_connection (command,
			      GDA_CONNECTION (inh_product_search->connection));
  gda_command_set_text (command,
			query);
  result_set = gda_command_execute (command,
				    &count,
				    flags);

  gnome_db_grid_set_recordset (GNOME_DB_GRID
(inh_product_search->product_list),
			       result_set);

  gda_command_free (command);
}

On running this I get:

GDA_Connection_open returns 0
gda-connection.c: 70: gda_connection_real_error called

Any thoughts? 

And, to let everybody know first hand, this is part of a *real world* 
app I'm writing for a customer, using gnome-db, of course. More details
will come...




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