Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / October 2004



Tip: Looking for answers? Try searching our database.

Copy Recordset

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lou - 27 Oct 2004 20:14 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.