Page 1 of 1

The driver trucates queries with UpdateMode upWhereKeyOnly

Posted: Wed 28 Oct 2009 11:48
by dualsoft
I tried with dbexpmda.dll v4.40.0.18, Delphi 7
The driver trucates queries with UpdateMode is upWhereKeyOnly and I try to change the field in Key.
Here is the link with a test project:
http://www.winarhi.ro/temp/test.zip

When I call ApplyUpdates the driver generate truncated query like this:

Code: Select all

update  test1   se
where
  A  = 'test'
And shold be:

Code: Select all

update  test1   set A = 'other'
where
  A  = 'test'

Posted: Wed 28 Oct 2009 14:32
by Dimon
To solve the problem you should change the following line in your example:

Code: Select all

DataSet.FieldByName('A').ProviderFlags := [pfInKey];
to this line:

Code: Select all

DataSet.FieldByName('A').ProviderFlags := DataSet.FieldByName('A').ProviderFlags + [pfInKey];