Mort,
I want to copy the contents of one RS to another.
Thanks,
DG
Main Topics
Browse All TopicsHello,
Can anyone provide an example of updating one ADO recordset with another ADO recordset? Please let me know if I need to provide some clarification.
Thanks,
DG
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
See the following link:
http://www.w3schools.com/a
Hi David,
Here is some sample code for VB6 on Oracle:
Please note that this code is used to copy a row... you will have to do some more footwork to ensure PK violations don't occur.
What is the context of your requirement?
Private Sub Tester()
Dim rsOld As ADODB.Recordset
Dim rsNew As ADODB.Recordset
Dim nProgress As Integer
Dim nFieldCount As Integer
On Error GoTo EHTester
Set rsOld = New ADODB.Recordset
Set rsNew = New ADODB.Recordset
rsOld.Open "Select * From DbTable Where Key = 5", adoCon, adOpenDynamic, adLockBatchOptimistic
rsNew.CursorLocation = adUseClient
rsNew.Open "Select * From DbTable Where 1=2", adoCon, adOpenKeyset, adLockOptimistic
Do Until rsOld.EOF
If Not rsOld.EOF Then
rsNew.AddNew
nFieldCount = rsOld.Fields.Count - 1
For nProgress = 0 To nFieldCount
If rsNew.Fields(nProgress).Na
rsNew.Fields(nProgress).Va
Else
rsNew.Fields(nProgress).Va
End If
Next
End If
rsNew.Update
rsOld.MoveNext
Loop
Exit Sub
Resume
EHTester:
MsgBox Err.Number & " - " & Err.Description & " has occurred in frmMain.Tester", vbOKOnly + vbCritical, " Error! "
End Sub
clone would create a copy (like a new pointer to the recordset) .. but deleting a record from the original recordset would delete the record in the copy too.
assuming u have the structure of both the recorsets .. try writing a code to loop thorugh the field and creating them
if u want to create a new recordset on the fly then
loop through the field collection of the original recordset and use the newrocordset.fields.append
Business Accounts
Answer for Membership
by: mort1652Posted on 2003-09-22 at 08:36:25ID: 9406482
Hi DG,
Do you mean copy the contents of one RS to another?
Or update the values in one RS from the values in another (field for field)?
Could you supply some clarification :)
Thanks
Mort