Automatic updatesql in TMSQuery

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Rudi Hostyn

Automatic updatesql in TMSQuery

Post by Rudi Hostyn » Tue 15 Mar 2005 14:27

How can I influence the automatic updatesql in TMSQuery?
I would like to use only one key field in the where clause of the update query. I have set providerflags pfKey in the fieldobject of the key field but that does not work (I do not have an UpdateMode property in TMSQuery). Is there another way to accomplish this task without manually filling in the UpdateSQL property?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 16 Mar 2005 09:30

The algorithm of the choice key fields in SDAC is greatly optimized and in common case, it uses minimal required set of the fields. According to that in your case several fields are used, there is no any unique key field in the query.

Most probably, changing table structure with specifying an unique key filed will solve the problem

Rudi Hostyn

Post by Rudi Hostyn » Thu 17 Mar 2005 11:09

Putting a key on the table solved the problem.
Thank you!

Post Reply