Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    6

    Unanswered: update table with a field from another table

    I need to update all fields from one table with all fields from another table in the same database. Any suggestions would be greatly appreciated.
    Thanks,
    Wade carlson

  2. #2
    Join Date
    Sep 2003
    Location
    Newark, Vermont
    Posts
    20
    <!--#include virtual="adovbs.inc" -->
    <%
    dim DB, RS
    set DB = Server.CreateObject("adoDB.connection")
    DB.mode = adModeReadWrite
    DB.open("provider=microsoft.jet.oleDB.4.0;data source=" & Server.Mappath("data.mDB"))
    set RS = Server.CreateObject("adoDB.recordset")
    RS.Open "SELECT * FROM table1", DB, AdOpenStatic, AdLockPessimistic
    set RS2 = Server.CreateObject("adoDB.recordset")
    RS2.Open "table2", DB, AdOpenStatic, AdLockPessimistic, adCmdTable
    Do While Not RS.EOF
    RS2.AddNew
    RS2("name") = RS("name")
    RS2.Update
    RS.MoveNext
    Loop
    %>

Posting Permissions

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