Information générale
Titre:
Copying a recordset in VB6
Hi,
I have a question on object copying in VB6.
With the following code...
Dim strSQL As String
Set mrecMaster = New ADODB.Recordset
Set mrec1 = New ADODB.Recordset
Set mrec2 = New ADODB.Recordset
Set mrec3 = New ADODB.Recordset
strSQL = "SELECT Adr_NRI FROM Address "
mrecMaster.CursorLocation = adUseClient
mrecMaster.Open strSQL, cnConnect, adOpenStatic, adLockReadOnly
Set mrecMaster.ActiveConnection = Nothing
Set mrec1 = mrecMaster
Set mrec2 = mrecMaster
Set mrec3 = mrecMaster
So basically, I'm copying a master recordset to 3 other recordsets. I thought that since I was copying the master recordset, I was making copies (independent copies) of this recordset.
But when I do a MoveNext (example) on one of these 4 recordsets, ALL the recordsets move next...
How come?
Thanks!
-Michael Pelletier
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement