Board index » delphi » Help: Query won't update... (newbie)

Help: Query won't update... (newbie)

Hello,

I've got query and a table.
They are both active.

When I run the query, it counts the number of entries of the table.
But when I add or delete a record (and Post it) and then rerun the
query, the number of entries havn't changed. When I restart the whole
application though, it has changed.

What do I do wrong?
I tried several update-methods and so on...
If you kwow what I do wrong, pleas tell me...
Thanx in advance,

Bjorn Vrijkorte

My code to run the query:

begin
  { run query }
  TotQuery.Open;

  { show number of entries
  Label1.Caption := TotQuery.FieldByName('Tot').AsString;

  { close query }
  TotQuery.Close;
end

 

Re:Help: Query won't update... (newbie)


Quote
b.d.vrijko...@student.utwente.nl (Bjorn Vrijkorte) wrote:
> Hello,

> I've got query and a table.
> They are both active.

> When I run the query, it counts the number of entries of the table.
> But when I add or delete a record (and Post it) and then rerun the
> query, the number of entries havn't changed. When I restart the whole
> application though, it has changed.

Your changes are probably cached. Either by some BDE-setting, the
CachedUpdates property of your TTable or some feature...

If it's not the BDE nor the TTable, try DbiSaveChanges. Look that up
in the BDE help files.

Jasper

Other Threads