Académique Documents
Professionnel Documents
Culture Documents
' Loop through the array so that on each pass the user
' is searching a different copy of the same Recordset
Do
For intLoop = 1 To 3
' Ask for search string while showing where
' the current record pointer is for each Recordset
strMessage = _
"Recordsets from stores table:" & vbCr & _
" 1 - Original - Record pointer at " & arstStores(1)!stor_name
& vbCr & _
" 2 - Clone - Record pointer at " & arstStores(2)!stor_name &
vbCr & _
" 3 - Clone - Record pointer at " & arstStores(3)!stor_name &
vbCr & _
"Enter search string for #" & intLoop & ":"
strFind = Trim(InputBox(strMessage))
' make sure something was entered, if not then EXIT loop
If strFind = "" Then Exit Do
' clean up
arstStores(1).Close
arstStores(2).Close
arstStores(3).Close
Cnxn.Close
Set arstStores(1) = Nothing
Set arstStores(2) = Nothing
Set arstStores(3) = Nothing
Set Cnxn = Nothing
Exit Sub
ErrorHandler:
' clean up
If Not arstStores(1) Is Nothing Then
If arstStores(1).State = adStateOpen Then arstStores(1).Close
End If
Set arstStores(1) = Nothing
If Not arstStores(2) Is Nothing Then
If arstStores(2).State = adStateOpen Then arstStores(2).Close
End If
Set arstStores(2) = Nothing
If Not arstStores(3) Is Nothing Then
If arstStores(3).State = adStateOpen Then arstStores(3).Close
End If
Set arstStores(3) = Nothing