Re: Exit Do Statement

Results 1 to 2 of 2

Thread: Re: Exit Do Statement

  1. #1
    Join Date
    Dec 1969

    Default Re: Exit Do Statement

    Hi All<BR>I made this Exit Do Satement for my access 2000 DB Query<BR>and im just wondering if the recordset and database connection is actually being closed.<BR>I dont know where the code jumps to when using the Exit do statement??<BR>sql select ..... &#039query<BR>rs = Conn.Execute(sql) &#039opens my connection + record set<BR>varCount = 0 &#039sets my counter to 0<BR><BR><BR>On Error Resume Next<BR>rs.MoveFirst<BR>do while Not rs.eof<BR>varCount= (varCount + 1) &#039increases my Counter<BR>IF varCount = 10 THEN Exit do &#039where will this code exit to?<BR><BR> &#039area that displays my records<BR><BR>rs.MoveNext<BR>loop<BR>rs.close<BR> Set rs=Nothing<BR>Conn.Close<BR>Set Conn=Nothing<BR><BR>Does the Exit do jump down to the Loop and continue from there?<BR>Everything works fine I just not sure when the exit jumps to and i want to make sure im closing & cleaning up right here.<BR><BR>Thanks for the Help :o)<BR>Roy<BR><BR>

  2. #2
    Eddie Campbell Guest

    Default RE: Re: Exit Do Statement

    The exit do will move the code execution to the next line outside of your loop. So yes, it will close the connection.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts