Click to See Complete Forum and Search --> : Appending Records
hi_vijay
Mar 20th, 2000, 05:16 PM
Hi,
I have two ADO recordsets (rs1 and rs2) with same fields. I want to append data of rs2 in rs1. One way is, I will fetch each record and each field and by using AddNew, Update method I can append data. but both recordset contains more than 20000 records each this takes lot of time to complete the task. Is there any effecient way to do it can we do bulk append?
Thanks in Advance.
browner
Mar 20th, 2000, 06:13 PM
Set your RS (just 1 RS is needed) to
"Select * From table1 Union Select * From Table2;"
Hope this helps.
hi_vijay
Mar 20th, 2000, 06:54 PM
Solution which you are telling is correct but I don't want to requery the database cuz data which I fetch in the recordsets may get changed. I don't want to requery on the database. I just want to append records from one recordset to another.
Thanks.
browner
Mar 20th, 2000, 07:19 PM
I don't know then - but I do know that when you change a recordset you are effectively changing the database - so it should not matter if you requery the db - the data should still be accurate. If you do find a solution post it out of interest.
alwsid
Mar 23rd, 2000, 04:46 PM
Private Sub Command1_Click()
On Error GoTo Err_AppendData
Dim dbs As Database
Set dbs = OpenDatabase("c:\TestAppend.mdb")
dbs.Execute "INSERT INTO Temptable SELECT * " _
& "FROM Table1;"
dbs.Close
Exit_AppendData:
Exit Sub
Err_AppendData:
MsgBox Err.Number & " : " & Err.Description
Resume Exit_AppendData
End Sub
hi_vijay
Mar 23rd, 2000, 08:03 PM
Thanks for reply,
But I don't want to execute any "SELECT" query from the database. I want to only append records in the memory. Let's consider there is no database exists and I had append all records manually. No active connection is present.
fkauffman
Jun 21st, 2000, 03:44 PM
Aahhh, same question, hoped to find the answer here.
I also want to append a recordset to another recordset, both disconnected from the database, just in memory on the clients machine.
Did someone already find a solution? (I'm sure someone did, just need to find this person or find the solution myself)
Fedor
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.