Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Adding Key to Multiple Tables


Message #1 by "Stephen Proctor" <steveproctor@c...> on Sun, 27 Jan 2002 04:48:22
I want to add a record to a database.  As part of that, I want to add the 

key number to multiple tables.  The syntax I am using for one table is:



objRS.Open "Table1", strdb, adOpenStatic, adLockOptimistic, adCmdTable	

	

 objRS.AddNew

 objRS("Number")=Request.Form("Number")

 objRS("Name")=Request.Form("Name")

 

 objRS.Update



The number field is the key field.  How do I add the key field to other 

tables?  Is the best way to use the same as above, only open the second 

table separately and add the key field only?  (Is it OK to leave the other 

fields blank?)  Or is there a more efficient way to add the key number to 

multiple tables with one command?



Much thanks.



Steve

  Return to Index