|
-
Nov 1st, 2002, 12:38 PM
#1
Thread Starter
Addicted Member
How to close ADO Recordsets en mass?
Hey guys,
Does anyone know of a way to close all the open ADO recordsets without having to refer to them individually by name?
For example, I have about 20 recordset objects which I currently close like this:
rs1.close
rs2.close
rs3.close
...etc.
I'd like to be able to just run a loop which would automatically close all open recordsets, just like you can close all open forms with a forms collection, for example. Is it possible?
-
Nov 1st, 2002, 08:38 PM
#2
Lively Member
You can write an object/collection wrapper which will hold references of all opened recordsets, so that when you open recordset you use Add method of this object. This object should have method CloseAll, which internally will loop through all recordsets and close them.
-
Nov 1st, 2002, 08:45 PM
#3
Frenzied Member
VB Code:
Dim RS(1 To 4) AS New ADODB.Recordset
set RS(1) = oConn.Execute(My-SQL-Stuff)
set RS(2) = "
" "(3) = "
" "(4) = "
Dim i as integer
For i=1 To 4
RS(i).Close
Next i
That should also work?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|