General information
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only