Re: A couple of things here
Thank you.
I realized my mistake after that.
The code you suggested below could work,and no erro occured.
But I want all the recordset keep the state of 'open',I can't do that.
In each circle,a new recordset is opened,but the previous one is close.
How to manage this?
Thanks very much.
hmmm, not sure what to tell you...
i added some Debug.Print statements after the code example
I posted, and according to what printed, the recordsets are
all open...
Code:
Private Sub Command1_Click()
Dim CollectCnn As ADODB.Connection
Dim Collection(10) As ADODB.Recordset
Dim i
Set CollectCnn = New ADODB.Connection
CollectCnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Archivos de programa\Microsoft Visual Studio\VB98\Nwind.mdb;Persist Security Info=False"
For i = 1 To 10
Set Collection(i) = New ADODB.Recordset
Collection(i).Open "Select * From Employees", CollectCnn, 3, 3
Next
For i = 1 To 10
Debug.Print "Open = " & adStateOpen & " Closed = " & adStateClosed & " State = " & Collection(i).State
Next
MsgBox "Done!"
End Sub
that works, so I am not really sure what to tell you...