Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copying a recordset in VB6
Message
De
18/02/2005 14:27:08
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Titre:
Copying a recordset in VB6
Divers
Thread ID:
00988445
Message ID:
00988445
Vues:
54
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
Fil
Voir

Click here to load this message in the networking platform