How can I do refresh or refetch only one record to browse grid?

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
developeradmin
Posts: 11
Joined: Tue 25 Mar 2008 09:55

How can I do refresh or refetch only one record to browse grid?

Post by developeradmin » Tue 03 Jun 2008 13:55

How to refresh or refetch only one record to browse grid?
(the record may be deleted, updated or appended)
Best Regards

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 04 Jun 2008 08:32

You can refresh the current record using the RefreshRecord method. This method lets retrieving values of the current record or remove it from dataset if it was remove at the server. If the record was deleted, you will get an exception which can be suppressed by setting Options.StrictUpdate to False. For more information see descriptions of the SQLRefresh property and the RefreshQuick method in the SDAC help.

mariusz
Posts: 62
Joined: Wed 16 Jul 2008 21:04
Location: Poland / Poznan
Contact:

Re: How can I do refresh or refetch only one record to browse grid?

Post by mariusz » Wed 12 Feb 2014 14:19

Hi there... I'd like refresh a bit this topic...

I have Query with some set of records. For various reasons, I must to add new record to database from the side (not using this query insert/append). I'm looking for fastest and causing the smallest network traffic way to fetch that one inserted / appended record and append it to dataset.

Do you have any idea / way to do that?

(in fact I need it in PGDac component, but I think that question can be more general, because it could be quite useful also with other DAC components.

regards
M.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: How can I do refresh or refetch only one record to browse grid?

Post by AlexP » Wed 12 Feb 2014 16:32

This capability depends on the server. Please specify the DB you are working with.

mariusz
Posts: 62
Joined: Wed 16 Jul 2008 21:04
Location: Poland / Poznan
Contact:

Re: How can I do refresh or refetch only one record to browse grid?

Post by mariusz » Thu 13 Feb 2014 23:45

Well... I/we work with number of different servers... SQL server 2008, Postgres 9.2, Firebird 2.5... sometimes also with Oracle 9.2 and 11 and MySQL 5.5.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: How can I do refresh or refetch only one record to browse grid?

Post by AlexP » Fri 14 Feb 2014 12:07

This functionality is supported in ODAC and SDAC in the OraChangeNotification and MSChangeNotification properties respectively, and in MyDAC - in the AutoRefresh property. Implementation examples are in the demos of each product. The other databases don't support such functionality, therefore to retrieve data, you should manually call DataSet update.

Post Reply