Board index » delphi » TQuery, CachedUpdates and Delphi 4

TQuery, CachedUpdates and Delphi 4

When using a TQuery with cached updates on a Paradox table, the BDE
does  not apply the updates.  Using a TTable works.  Any ideas?

I have an TUpdateSQL defined with the correct ModifySQL statement (it
works for the TTable).  I know I have done this many times - for some
reason it no longer works.

Code:

  dbContacts.StartTransaction;
  try
    if (not dbContacts.IsSQLBased) and not (dbContacts.TransIsolation =
tiDirtyRead) then
       dbContacts.TransIsolation := tiDirtyRead;
    with qryPeople do
    begin
      if Modified then
         Post;
      if UpdatesPending then
      begin
        ApplyUpdates;
        CommitUpdates;
      end;
    end;
    dbContacts.Commit;
  except
    dbContacts.Rollback;
    raise;
  end;
  with qryPeople do
  begin
    Close;
    Open;
  end;

 

Re:TQuery, CachedUpdates and Delphi 4


here is a solution, posted just a few messages above yours...

SOLVED: TQuery and Cached Updates D4 bug
        Date:
             Tue, 14 Jul 1998 10:01:47 +0200
        From:
             Javier Tari Agullo <jt...@ctv.es>
 Organization:
             Another Netscape Collabra Server User
  Newsgroups:
             borland.public.delphi.database.desktop

Hi!

Under D4, using CachedUpdates with a TQuery did not worked properly.
Under some circumstances, never called the OnUpdateRecord or used the
UpdateObject.

Changing the line 8042 on DBTables.pas VCL source file from:

SetBoolProp(StmtHandle, stmtCANNEDREADONLY, False);

to

SetBoolProp(StmtHandle, stmtCANNEDREADONLY, Not RequestLive or
ForceUpdateCallback);

Seems works fine.

To let you know, in D3 that line used TRUE in place of FALSE, and the
bug affects only Local databases.

Hope it helps someone!

Regards,
    Javier Tari
    Spain

Other Threads