[Gambas-devel] CTable.c primary key query

Nigel Gerrard nigel at ...2...
Wed Feb 25 19:02:06 CET 2004


Benoit,

If you create a table outside of the gambas-database-manager and you do not create a primary key,you cannot go into the gdm and then create a primary key afterwards unless line 548 of CTable.c (CTable_update) is changed from:

if (!This->primary || GB.Count(THIS->primary) ==0)

to

if (!This->primary)

I know there seems little logic in this...but it does work and I do believe that tables created outside gambas should still be accessible.
What do you think?

Also in CResult.c from line 468, I would suggest checking that there is a key for the "WHERE" clause to use. e.g:

if (!THIS->edit)
{
   GB.Error("No key for Update");
}
else {
       q_add(THIS->edit);
       THIS->driver->Exec(THIS->db->handle, q_get(), NULL, "Cannot modify record: &1");
}

break;

This is because the message provided from doing a failed query syntax is not neccessarily very clear.

Nigel  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20040225/03e41080/attachment.html>


More information about the Devel mailing list