Update in memory records

Update in memory records

Postby Stef Merlijn » Fri 23 Jan 2009 23:34


Can you please explain to me how I can accomplish the following?

1. At start-up of my application I load serveral tables in memory.
These tables are used for LookupComboBox-fields.
2. All changes to databasetables will be recorded in a log-table
showing tablename, username and change-datetime
3. Application will run SQL (Threaded Timer) in order to determine
tables that were changed after last check and will ideally only retrieve
changed records (based on last change DateTime of records).

Databasetable MyTableA contains 3 records
- 1 name1
- 2 name2
- 3 name3

MyTableA is loaded into Memory_MyTableA + LastReload-DateTime is recorded

MyTableA is changed.
- 2 newname 23-01-2009 12:30
Log-table entry is added
- 23-01-2009 12:30 MyTableA User1

Application will retrieve changed records from MyTableA
- 2 newname 23-01-2009 12:30

MyTableA is updated
- 1 name1
- 2 newname
- 3 name3

Is there a way to remove, add and update records in memory based on retrieved changes from database (see 3)? In other words is it possible to limit networktrafic and not load all records when some table is changed?
Do you have some best practice for this kind of situation? How to set it up?

Thanks, Stef
Stef Merlijn
Posts: 2
Joined: Fri 23 Jan 2009 23:08

Postby Plash » Mon 26 Jan 2009 08:58

You can call the RefreshRecord method for a changed record.

Note that TVirtualTable does not have this method. It is available for normal tables such as TOraTable, TMSTable, etc.
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Return to VirtualDAC