I have an variable
Dim ado As ADODB.Recordset.
it gets populated, Now I need a Copy NOT a reference of this recordset.
How do I make a copy of this instead of a reference to this
Dim cpAdo As ADODB.Recordset
Set cpAdo=ado 'This just sets a reference??
-Lou
Wart - 27 Oct 2004 20:59 GMT
Try Cloning the RS.
Set RSClone = RSOriginal.Clone
HTH,
CF
>I have an variable
>
[quoted text clipped - 7 lines]
>
> -Lou
Val Mazur - 30 Oct 2004 02:33 GMT
Hi,
Cloning does not create real copy of the recordset as well and recordset are
synchronized in some cases. To get real copy of the recordset, you would
need to use Stream. Here is an example (assuming that you have recordset
opened already)
Dim loStream As ADODB.Stream
Dim loCopyRecordset as ADODB.Recordset
.......
Set loStream = New ADODB.Stream
oStm.Open
loSourceRecordset.Save oStm, adPersistXML
Set loCopyRecordset = New ADODB.Recordset
loCopyRecordset.Open loStream

Signature
Val Mazur
Microsoft MVP
>I have an variable
>
[quoted text clipped - 7 lines]
>
> -Lou