Page 1 of 1

TORATable 'live view'

Posted: Wed 25 Mar 2009 15:20
by h.hasenack
Hello

I'm currently implementing ODAC as an alternative to NexusDB, and I have already come very far. My App in fact runs!

Here's still some trouble:
I'm used to using 2 table components for access to the same DB table, one for editing, and one for looking up data.

Here 's the trouble: when a record is posted using the edit table, the record cannot be found (using eg findkey, locate) in the lookup table. Well, until the table is closed and opened.

Any idea how to come by this? I need the 2nd table e.g. for my custom Data aware TTree component that loads nodes from the lookup table, but does the navigating on the edit table.

Regards - Hans

Posted: Thu 26 Mar 2009 08:09
by Plash
You should call the Refresh method for your lookup table after posting a record to the edit table.

Posted: Thu 26 Mar 2009 10:14
by h.hasenack
Plash wrote:You should call the Refresh method for your lookup table after posting a record to the edit table.
I am trying to avoid changing my program logic as much as possible. Adding a refresh for each afterpoast/afterdelete event is rather tedious.

Currently I use "locate" and "findkey" to locate the posted record. Does "Refresh" do something else but reloading the 'current' record? (like re-execute the entire query?)

Maybe the solution is in the using ChangeNotify component... (No luck so far)

UPDATE
I tried using SmartRefresh=True, but it causes an AV. Why? Do i need pro or dev version? I'm still using the evaluation version.

Posted: Fri 27 Mar 2009 07:54
by Plash
The Refresh method reloads the whole dataset. You can use the Locate method, and then RefreshRecord method to reload only record that was changed.

Using the TChangeNotification component is not recommended because it may require special server configuration to work normally.

SmartRefresh should work in Trial edition. We cannot reproduce an access violation. Please send to odac*devart*com a complete small sample that demonstrates the problem, including the script for creating database objects.

Posted: Fri 27 Mar 2009 08:31
by h.hasenack
You can use the Locate method, and then RefreshRecord method to reload only record that was changed.
Locate/findkey is unable to find a new record that has just been posted in the other instance of TOraTable. I guess this renders using refreshrecord for new records impossible. (not tested yet). RefreshRecord is probably only available for pre-existing records.

Using the TChangeNotification component is not recommended because it may require special server configuration to work normally.
Yes I noticed. changing the security didn't help.
Please send to odac*devart*com a complete small sample that demonstrates the problem, including the script for creating database objects.
I'll have to look into that one if I can find the time.

Regards

Posted: Mon 30 Mar 2009 07:19
by Plash
Yes, the Locate method cannot find a record that was added to another instance of TOraTable. If you add a new record, you can call the Refresh method to reload all data. When you edit an existing record you can use the RefreshRecord or Refresh methods.