Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Closing stored procedure within loop

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,69
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Closing stored procedure within loop
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Closing stored procedure within loop - 5/31/2001 12:41:12 AM   
  dougc

 

Posts: 12
Score: 0
Joined: 5/31/2001
From: USA
Status: offline
I'm calling two stored procedures (get_three and get_five)that are each returning a record set. I'm calling the first one then starting a loop until eof, where I use data from the first recordset to call the second...


DE.Get_three
Do until DE.rsGet_three.eof
three_id = DE.rsGet_three(1)("three_id")
DE.Get_five three_id
Do until DE.rsGet_five.eof
'display data here...
DE.rsGet_five.movenext
loop
DE.rsGet_three.movenext
loop


Loop one executes fine (the internal loop completes until eof) but after the get_three loop executes once I get "The operation requested by the application is not allowed if the object is open" on the line containing the call to the get_five procedure. I'm guessing I need to close the object before I call the procedure again with different data but I can't figure out how. I have tried DE.get_five.close and DE.rsGet_five.cancel, but doesn't seem to have any effect.

Any help would be greatly appreciated!
 
 
Post #: 1
 
 Re: Closing stored procedure within loop - 5/31/2001 12:41:44 AM   
  dougc

 

Posts: 12
Score: 0
Joined: 5/31/2001
From: USA
Status: offline
FYI: I fixed this by closing the recordset (DE.rsGet_five.close )

DE.Get_three
Do until DE.rsGet_three.eof
three_id = DE.rsGet_three(1)("three_id")
DE.Get_five three_id
Do until DE.rsGet_five.eof
'display data here...
DE.rsGet_five.movenext
loop
DE.rsGet_Five.close
DE.rsGet_three.movenext
loop

(in reply to dougc)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Closing stored procedure within loop Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts