Solution for SQLA cached updates memo corruption through ODBC link

Good news!!

Jonathan Kimber wrote..

Quote
>Another way of getting around the problem (if I remember correctly!)
is to
>use 2 TQuery components. One TQuery  (Query1) (is used for all
fields except the
>VARCHAR field and set "Cached Updates" to true.
> ...
>set "RequestLive" to true (query2). The 2nd query is only returning
the VARCHAR
>field, ...

In addition to the above....

Use a TUpdateSQL with query1. unselect the LONG VARCHAR field in the
TUpdateSQL - generateSQL.. Use all the fields as TFields linked to
datacontrols as normal..

Use the following in a TDatabase transaction.. in case u wanna
rollback..

procedure TForm1.Query1AfterPost(DataSet: TDataSet);
begin
  Query1.ApplyUpdates;
  Query1.CommitUpdates;

  // Only modification needed....
  with Query2 do
  begin
    SQL.Clear;
    SQL.Add('UPDATE Test');
    SQL.Add('SET MemoField = ''' + Query1MemoField.AsString + '''');
    SQL.Add('WHERE IntegerKey=''' + Query1IntegerKey.AsString +
'''');
    ExecSQL;
  end;
end;

I have tested it roughfly, but it seems to work under the conditions
for evaluationg the corruption before...

Thanks Jonathan!

Siegs  :D