If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > update table with a field from another table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-25-03, 13:29
wadecarlson wadecarlson is offline
Registered User
 
Join Date: Sep 2003
Posts: 6
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
Reply With Quote
  #2 (permalink)  
Old 09-28-03, 15:26
jlot6 jlot6 is offline
Registered User
 
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
%>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On