Update without CloseOpen

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
syrov_andrei
Posts: 6
Joined: Mon 09 Jan 2006 07:16
Contact:

Update without CloseOpen

Post by syrov_andrei » Mon 29 Oct 2007 14:46

I work with SDAC 3.8
I Have a TMSQuery, record set work with data from many tables.
Some thread of my Application get infomation from outside and save this information to the database.
I want update record in record set of TMSQuery, but not reopen or call refresh of this Query, becouse I have all of needed data to show new value of each field of TMSQuery in my program.
What kind of method I must call.
Thanks.

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

Post by Antaeus » Mon 29 Oct 2007 16:15

The RefreshQuick method may be useful in some cases, but it cannot work with compound queries.

syrov_andrei
Posts: 6
Joined: Mon 09 Jan 2006 07:16
Contact:

Post by syrov_andrei » Tue 30 Oct 2007 04:45

Antaeus wrote:The RefreshQuick method may be useful in some cases, but it cannot work with compound queries.
...Can I write some values to record of DataSet use method SetFields or other ?

I want show in record values, which I apply to database, and I have this values in application, but I don`t want reopen or refresh dataset, beacouse this take some time.

Can I write my values to adress in memory and after that show its in record of dataset ?
What method or properties I must use ?

Thanks.

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

Post by Antaeus » Wed 31 Oct 2007 13:28

If the RefreshRecord is not an appropriate solution, I can suggest you another way.
This way requires that your application know what values must be changed. Just set the TMemDataSet.LocalUpdate property to True, and change all records you need by Edit/Post. Update commands will not be sent to the server.

Post Reply