Status & Roadmap
Authors & License
Funding Ultimate++
Search on this site
Search in forums

SourceForge.net Logo
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 Go to previous message
alca is currently offline  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.AddColumn(ID, t_("ID") ).Edit(_id).NoEdit();
_arr.AddColumn(DESC, t_("Descr")).Edit(_desc);
_arr.AddColumn(COST, t_("Cost") ).Edit(_cost);

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++! Smile

[Updated on: Wed, 23 January 2013 11:29]

Report message to a moderator

Read Message
Read Message
Read Message icon14.gif
Read Message
Previous Topic: How to use Sqlite BLOB type in U++ schema files?
Next Topic: Reading S_xxxx records from Sql
Goto Forum:

Current Time: Sun Jul 14 03:43:46 CEST 2024

Total time taken to generate the page: 0.01749 seconds