Refresh SingleNew Record

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
GNiessen
Posts: 28
Joined: Wed 18 Jan 2012 20:15

Refresh SingleNew Record

Post by GNiessen » Fri 08 Feb 2013 19:02

I have a read-only query that I am adding a record to with a separate Store Procedure. I want to Refresh the query to bring in the new record, with out having to re-query the entire set of records (can be a large number). Can RefreshRecord be used to do this?

AndreyZ

Re: Refresh SingleNew Record

Post by AndreyZ » Mon 11 Feb 2013 09:07

If an existent record was modified on the server, you can refresh it on the client using the RefreshRecord method. But if a new record was added, you can obtain it on the client only by refreshing a dataset. There are two ways to refresh a dataset, using the Refresh or RefreshQuick methods. The main difference between the RefreshQuick and Refresh methods is that RefreshQuick does not transfer all data to the client like the Refresh method does. The only rows that were added or modified from the moment of the last refresh are returned to a client. The necessity of data inquiry for each row is defined by the TIMESTAMP field. So the RefreshQuick method requires query to include a unique key fields and a TIMESTAMP field.
If you do not want to use the RefreshQuick method, the only other way is to refresh the whole dataset by calling the Refresh method.

GNiessen
Posts: 28
Joined: Wed 18 Jan 2012 20:15

Re: Refresh SingleNew Record

Post by GNiessen » Fri 22 Feb 2013 21:58

The RefreshQuick sounds like what I need. I will try that. Thanks.

AndreyZ

Re: Refresh SingleNew Record

Post by AndreyZ » Mon 25 Feb 2013 10:13

I am glad I could help.

Post Reply