Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maintaining position after a Requery

Status
Not open for further replies.

NuWood

Programmer
Mar 14, 2002
44
0
0
GB
Hi

I need to refresh datasets using ADO and the requery method. This works fine of course and I can maintain the record position so I don't go back to the top.

Now If I associate a child dataset with this the requery of the parent causes the child to requery. Now I could of course record the bookmark for this and restore it afterwards.

I have an application that has a parent table with around 6 child datasets depending on it. To add to that some of these child datasets are parents to the next level down. So when I requery the top level parent I need to restore all bookmarks in all children and grand children.

This is a real drag. Is there anyway to automate this? Is there an ADO property to maintain position? Is there some smart component that will do this for me? I have been developing DELPHI for some time now but I feel in this area that either

1. No one has thought about this ever
2. I lack some technique knowledge that others take for granted

I assume 2 is the case and look forward to any assistance.

By the way I have tried BeforeRefresh/AfterRefresh but when I use Requery it does not execute the event. I tried OnWillMove and OnMoveComplete and have had almost cracked it but the use of the bookmark restore of the parent seems to mess this up.


regards
[2thumbsup]
 
I don't know if this will help you but instead of using Bookmarks, I've used key field values to move to the correct record. You store the key field values prior to the call to ReQuery and then do a Locate to set the record pointer to the correct place.

-Dell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top