n disconnected recordsets

n disconnected recordsets

Post by Doug Bel » Tue, 06 Apr 2004 15:46:18


Hi,
I am trying to connect to a DB and return several (disconnected)
recordsets.
The problem that I am having is that the number of recordsets that I want to
return is not predefined and I want to have them all current when they are
opened.

How can I dynamically declare variable for each recordset?
For lnRsNo = 1 To lnRss
Dim rs(lnRsNo) as ADODB.Recordset ' something like this?
'etc.
'................
Next lnRsNo
 
 
 

n disconnected recordsets

Post by Val Mazu » Fri, 09 Apr 2004 00:12:12

Hi,

It should be something like

Dim rs(0) as ADODB.Recordset

For lnRsNo = 1 To lnRss
Redim Preserve rs(lnRsNo)

Next lnRsNo


--
Val Mazur
Microsoft MVP