Bookmarks and DOA

ltd

Member²
Hello,

i try to transfer a project from BDE to DOA
(CBuilder5 and DOA 3.4.5).
In BDE we used the following "code".

GetBookmark();
disableControls();
acive=false;
Call to stored procedure to update row
active=true;
EnableControls;
GotoBookmark;
FreeBookmark;

This worked for us.

When i replace the BDE components with DOA
i get an error at the point "GotoBookmark"
which says that there is no Bookmark established.
Any suggestions ???
My fear is that we used an error of the BDE which did not invalidate the bookmarks when the Query is closed.
How can i position the the cursor in the grid to the correct position after an call to a stored proc and update the fields in the query.

Thanks for every suggfestions in advance

Lars
 
If your dataset has a rowid field, then the easiest way to restore the position is to save the rowid and perform a SearchRecord with this rowid later:
Code:
AnsiString SavedRowId;

SavedRowId = DataSet->RowId();
DataSet->Active = false;
DataSet->Active = true;
DataSet->SearchRecord("rowid", SavedRowId, TSearchRecordOptions());

------------------
Marco Kalter
Allround Automations
 
Hello Marco,

thanks for your tip. It works. :-)))

But there is one strange thing. I activate the function with a key press and the cursor stays at the updated row after the update. The grid has the focus. The strange thing is that when i press the update again without moving the cursor in the grid the gridcursor jumps to a different row. But when i move the marker in the grid erverything is fine. Is there a reason why the rowid is different when i make the update without moving the marking in the grid ??

Lars
 
The rowid is not different, maybe this is a problem with the current record state of the dataset or the grid. I can't reproduce this though. Do you close/open the dataset? If so, what happens if you call Refresh instead?

------------------
Marco Kalter
Allround Automations
 
Hello Marco,

i will investigate the problem next week.
I will keep you infromed about my results.

Lars
 
Back
Top