Home » U++ Library support » U++ SQL » How to view immediately the primary key in SqlArray
How to view immediately the primary key in SqlArray [message #38842] |
Wed, 23 January 2013 11:28 |
alca
Messages: 4 Registered: December 2012 Location: Italy
|
Junior Member |
|
|
Hello to all.
I'm trying to edit an sqlite table with SqlArray and I would show the id of each row in the first column.
It is the PRIMARY_KEY AUTO_INCREMENT field and I need only to show it (not edit it).
I used this code grabbed frome some examples:
EditString _id, _desc, _cost;
...
_arr.SetTable(MY_TABLE).AppendingAuto();
_arr.AddKey(ID);
_arr.AddColumn(ID, t_("ID") ).Edit(_id).NoEdit();
_arr.AddColumn(DESC, t_("Descr")).Edit(_desc);
_arr.AddColumn(COST, t_("Cost") ).Edit(_cost);
_arr.Appending().Removing();
_arr.SetOrderBy(ID);
_arr.Query();
That almost works, but I have problem when I add new rows:
the id editstring is left blank in SqlArray row until I exit the applicatin and restart it.
It seems that the id is showed only for consolidated rows in the table.
What I need is to see immediately the generated id as the used click "Insert record" context menu.
Can someone give me any hint?
Ah, and another newbie question:
can I set a callback in response of each modification (insert/edit/delete) on the table?
_arr <<= THISBACK(UpdatedTable);
can be the answer?
Many tanks in advance to all you guru, and keep on with U++!
Ciao
Alberto
[Updated on: Wed, 23 January 2013 11:29] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 26 00:26:46 CEST 2024
Total time taken to generate the page: 0.02913 seconds
|