By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,506 Members | 2,311 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,506 IT Pros & Developers. It's quick & easy.

Code to find recordsets that are not closed

P: n/a
Can someone help me with creating code that will look for DAO recordsets in
modules and then check to see if the recordset is also closed in the module.

All of my recordsets are of the form rs* where * is a wildcard for letters
after rs.

Thanks.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200611/1

Nov 12 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Sun, 12 Nov 2006 07:24:38 GMT, "rdemyan via AccessMonster.com"
<u6836@uwewrote:

CurrentDB.Recordsets has the collection of open recordsets.
-Tom.

>Can someone help me with creating code that will look for DAO recordsets in
modules and then check to see if the recordset is also closed in the module.

All of my recordsets are of the form rs* where * is a wildcard for letters
after rs.

Thanks.
Nov 12 '06 #2

P: n/a
Tom:

So if I get this collection, I'm not clear how I can loop through the
collection and close any open recordsets. Can you provide some code to get
me started.

Thanks.

Tom van Stiphout wrote:
>CurrentDB.Recordsets has the collection of open recordsets.
-Tom.
>>Can someone help me with creating code that will look for DAO recordsets in
modules and then check to see if the recordset is also closed in the module.
[quoted text clipped - 3 lines]
>>
Thanks.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200611/1

Nov 12 '06 #3

P: n/a
On Sun, 12 Nov 2006 17:19:11 GMT, "rdemyan via AccessMonster.com"
<u6836@uwewrote:

I was hoping you would find the Close method yourself ;-)

While CurrentDb.Recordsets.Count 0
CurrentDb.Recordsets(0).Close
Wend

Note that this code is better than:
For i = 0 to CurrentDb.RecordSets.Count -1
or similar constructs, because the Count will change each time you go
through the loop.

-Tom.

>Tom:

So if I get this collection, I'm not clear how I can loop through the
collection and close any open recordsets. Can you provide some code to get
me started.

Thanks.

Tom van Stiphout wrote:
>>CurrentDB.Recordsets has the collection of open recordsets.
-Tom.
>>>Can someone help me with creating code that will look for DAO recordsets in
modules and then check to see if the recordset is also closed in the module.
[quoted text clipped - 3 lines]
>>>
Thanks.
Nov 12 '06 #4

P: n/a
Thanks Tom.

I'm glad you mentioned the For/Next loop, because that is typically
how I would have coded it.

Tom van Stiphout wrote:
>I was hoping you would find the Close method yourself ;-)

While CurrentDb.Recordsets.Count 0
CurrentDb.Recordsets(0).Close
Wend

Note that this code is better than:
For i = 0 to CurrentDb.RecordSets.Count -1
or similar constructs, because the Count will change each time you go
through the loop.

-Tom.
>>Tom:
[quoted text clipped - 12 lines]
>>>>
Thanks.
--
Message posted via http://www.accessmonster.com

Nov 12 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.