9 Replies - 7926 Views - Last Post: 13 September 2002 - 01:12 AM Rate Topic: -----

#1 moleiro  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 15-March 02

Cursor location in Recordset

Posted 15 March 2002 - 10:55 AM

Once I've run a "Do While Not RS.EOF ... Loop", how do I reset the cursor to BOF so I can run another loop later in my script?
Is This A Good Question/Topic? 0
  • +

Replies To: Cursor location in Recordset

#2 klewlis  Icon User is offline

  • cur tu me vexas?

Reputation: 8
  • View blog
  • Posts: 1,723
  • Joined: 09-November 01

Re: Cursor location in Recordset

Posted 15 March 2002 - 02:05 PM

You can't.

At least, I've never found a way. You can either rerun the query, or store the Recordset in an array to use multiple times. :)

Was This Post Helpful? 0
  • +
  • -

#3 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: Cursor location in Recordset

Posted 24 July 2002 - 06:47 PM

Probably a little late with the answer, but if you just want to get back to the start, you should just be able to use one of the Move commands. RS.MoveFirst would be the best one, or if supported, just an RS.Move(place number here). HTH!
Was This Post Helpful? 0
  • +
  • -

#4 Fygar  Icon User is offline

  • I liek milk!!1
  • member icon

Reputation: 6
  • View blog
  • Posts: 4,361
  • Joined: 28-March 02

Re: Cursor location in Recordset

Posted 29 July 2002 - 07:51 AM

Yea, I'd say you want to use a MoveFirst for this case. That's what I use anyways...
Was This Post Helpful? 0
  • +
  • -

#5 klewlis  Icon User is offline

  • cur tu me vexas?

Reputation: 8
  • View blog
  • Posts: 1,723
  • Joined: 09-November 01

Re: Cursor location in Recordset

Posted 30 July 2002 - 08:09 AM

You use MoveFirst after looping through to EOF?

Cuz I'm pretty sure that doesn't work ;)
Was This Post Helpful? 0
  • +
  • -

#6 Fygar  Icon User is offline

  • I liek milk!!1
  • member icon

Reputation: 6
  • View blog
  • Posts: 4,361
  • Joined: 28-March 02

Re: Cursor location in Recordset

Posted 30 July 2002 - 12:08 PM

Sure it does, unless I'm missing something in this topic...

Do Until Rs2.EOF
    Lots' of code....
    Rs2.MoveNext
Loop

Rs2.MoveFirst

Do Until Rs2.EOF
    Lots' of other code....
    Rs2.MoveNext
Loop



See, using .MoveFirst to get to the First record to begin a new loop....
Was This Post Helpful? 0
  • +
  • -

#7 klewlis  Icon User is offline

  • cur tu me vexas?

Reputation: 8
  • View blog
  • Posts: 1,723
  • Joined: 09-November 01

Re: Cursor location in Recordset

Posted 30 July 2002 - 01:37 PM

hm... that's weird. i've never been able to get it to work. i've always had to re-run the query...
Was This Post Helpful? 0
  • +
  • -

#8 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: Cursor location in Recordset

Posted 30 July 2002 - 06:17 PM

Hmm....should work, unless the recordset has been closed, or something like that.
Was This Post Helpful? 0
  • +
  • -

#9 Fygar  Icon User is offline

  • I liek milk!!1
  • member icon

Reputation: 6
  • View blog
  • Posts: 4,361
  • Joined: 28-March 02

Re: Cursor location in Recordset

Posted 31 July 2002 - 06:15 AM

What cursor type, lock, etc are you using?
Was This Post Helpful? 0
  • +
  • -

#10 gheaven  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 13-September 02

Re: Cursor location in Recordset

Posted 13 September 2002 - 01:12 AM

You need to use an adOpenKeyset results set. The default is adForwardOnly.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1