Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying a recordset in VB6
Message
From
18/02/2005 14:27:08
 
 
To
All
General information
Forum:
Visual Basic
Category:
Other
Title:
Copying a recordset in VB6
Miscellaneous
Thread ID:
00988445
Message ID:
00988445
Views:
56
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
Map
View

Click here to load this message in the networking platform