Results 1 to 7 of 7

Thread: Appending Records

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    10
    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.

  2. #2
    Junior Member
    Join Date
    Mar 2000
    Posts
    29
    Set your RS (just 1 RS is needed) to

    "Select * From table1 Union Select * From Table2;"

    Hope this helps.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    10
    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.

  4. #4
    Junior Member
    Join Date
    Mar 2000
    Posts
    29
    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.

  5. #5
    Lively Member
    Join Date
    Aug 1999
    Location
    Malaysia
    Posts
    108

    Append Recordset To Another Table

    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

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    10
    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.


  7. #7
    Lively Member
    Join Date
    Jun 2000
    Posts
    80

    Unhappy

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width