Board index » delphi » bookmark/Access --not a valid bookmark table?

bookmark/Access --not a valid bookmark table?

I'm frequently receiving an error message on bookmarking
an access table after performing a query1.next procedure.
The FIRST try is OK, then after moving the record, it get the
error message below;

Here is the code:

procedure rfresh
var bk: tbookmark;
begin
try
  bk := query1.GetBookmark;
  Query1.disablecontrols;
  Query1.close;
  Detailquery2.close; //this is a master detail query
  Query1.open;
  Query1.gotobookmark(bk);
  Query1.enablecontrols;
  Detailquery2.open;
finally
  Query1.freebookmark(bk);
end;

On freebookmark code, I get :    "GENERAL SQL ERROR NOT
A VALID BOOKMARK TABLE."

This happens on the SECOND try, after moving the record using
query1.next;

Any ideas?

Thanks!

 

Re:bookmark/Access --not a valid bookmark table?


1. Why does this method work in most cases ?
2. I thought that since refresh did not work with tquery, opening and
    closing the dataset was necessary.
3. It was my understanding that bookmark as the suggested method to
    save record location.

4. If bookmark is out, then afterclosing a dataset, there is no method
    to find the record that user was on with tQuery.  The Locate method
    can be used on a tquery, but is very slow. I can use the "WHERE"
    clause, but not very practical for browsing records.

Please explain how to refresh a record using tQuery?

Quote
Bill Todd (TeamB) wrote in message <72ntjo$o6...@forums.borland.com>...
>Bookmarks are no longer valid after you close the dataset.

>--
>Bill Todd
>(Sorry but TeamB cannot answer questions received via email)
>(Remove nospam from my email address to contact me for any other reason)

Re:bookmark/Access --not a valid bookmark table?


The only method to refresh a query is to Close and reopen it. The only
method I know of to reliably restore location in a query result set is
Locate.

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Other Threads