Re: [gnome-db] More fun with apps



<SNIP>
> >
> this is not needed, since the call to gda_command_execute below will
> create the GdaRecordset

Hrmm, your example code and documentation should be changed to reflect
this then.

> 
> > 	cmd = gda_command_new ();
> > 	gda_command_set_connection (cmd, conn);
> > 	gda_command_set_text (cmd, "SELECT * FROM message where recipient = 'wlashell' order by date DESC");
> > 	rs = gda_command_execute (cmd, &reccount, blah);
> > 	
> > 	gtk_clist_clear( GTK_CLIST( msg_list ) );
> > 	printf( "query successful\n" );
> > 	while( ! gda_recordset_eof( GDA_RECORDSET(rs) ) )
> > 	{
> > /*		foo[0] = row_data[4];
> > 		foo[1] = row_data[2];
> > 		foo[2] = row_data[5]; 
> > 		gtk_clist_append( GTK_CLIST( msg_list ), foo); */
> > 		gda_recordset_move_next( rs );
> > 	}
> > 	}
> > }
> > 
> instead of this, why don't you use the GnomeDbGrid widget? It uses also
> a GtkCList, and does everything for you. You just have to associate a
> GdaRecordset with it:
> 
> GtkWidget *grid;
> 
> grid = gnome_db_grid_new (rs);

Well, in reply to another email, you said that if we use a grid, you basically
have to free the resultset to do anything. This is broken in my opinion because
i very likely will want to do something different to the resultset and shouldn't
have to query the dbms again to get a new one

> > 
> > which compiles just fine. but.. we get a segfault when it tries to 
> > execute.
> > I ran a backtrace and this is what I ended up with:
> > 
> > 0x407b6dd3 in strlen () from /lib/i686/libc.so.6
> > (gdb) bt
> > #0  0x407b6dd3 in strlen () from /lib/i686/libc.so.6
> > #1  0x40460251 in GDA_Connection_open () from /usr/lib/libgda-client.so.0
> > #2  0x40466174 in gda_connection_open () from /usr/lib/libgda-client.so.0
> > 
> ok, the problem seems here, in the CORBA code. Let me see.... yes, in
> this case, it was passing NULL values to the ORBit-generated functions,
> and there, a call to strlen with a NULL pointer made it crash.
> 
> It's now fixed in CVS (gnome-1-x-branch CVS branch)

Cool! What's the word on the release you've been planning?

Will


-- 
----------------------------------------------- 

"Doh.. STUPID STUPID STUPID"

--an excerpt taken from every developers cvs
  commit message at some point
-----------------------------------------------





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