Re: Effects on RST in Calling Proc
- From: rkc <rkc@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 03 Sep 2005 22:03:55 GMT
Tim Marshall wrote:
Here's the scenario, A2003, Jet back end, illustrated with some cut down code at the end of the post:
A proc dims a snapshot recordset (dim rst as Dao.recordset) and opens it. There are several nested do loops, going through the records in rst using .movenext. At one point in one of the loops, we'll say the rst is at record "a". Now, another subprocedure is called, passing rst to it.
In the subprocedure, the recordset goes through a do loop and the sub evaluates each record for various criteria, again, using .movenext. By the time the subproc is done with the recordset, it is at the last record. We then go back to the calling proc.
Will the recordset in the calling procedure still be at record "a"? Or will it be at the end?
I've assumed the last is true and for now, in the main procedure, I figure dimming a second recordset and setting it to the same as the first. I thought using the second set would bypass any problems running through the recordset in the second procedure.
Thanks for any comments on this.
Whether or not the effects of move operations on the recordset in the procedure it's passed to are reflected in the calling procedure on return is easily tested so I assume your question is does it make sense to open two recordsets. I'd say no. You can always save your position before passing the recordset and return to it after the call. I believe
that is a legitimate/safe use of a Bookmark.
.
- Follow-Ups:
- Re: Effects on RST in Calling Proc
- From: Steve Jorgensen
- Re: Effects on RST in Calling Proc
- From: David W. Fenton
- Re: Effects on RST in Calling Proc
- References:
- Effects on RST in Calling Proc
- From: Tim Marshall
- Effects on RST in Calling Proc
- Prev by Date: Re: Effects on RST in Calling Proc
- Next by Date: How to use static variable to exit function?
- Previous by thread: Re: Effects on RST in Calling Proc
- Next by thread: Re: Effects on RST in Calling Proc
- Index(es):
Relevant Pages
|