Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntaxis for INSERT?

Status
Not open for further replies.

gcastillo

Programmer
Jun 9, 2000
127
MX
Which is the exact syntaxs for an INSERT statment in two tables?? I have two tables, in table1 I have the fields w, x, y, z. In my table2 I have the fields y, z. How can i insert the data in both tables in just one operation?
Thank you!
 
do this
SQL #1
SQL1="INSERT INTO table1 (W,X,Y,Z) Values ("&_
"'"& request.form("W")& "', " &_
"'"& request.form("X")& "', " &_
"'"& request.form("Y")& "', " &_
"'"& request.form("Z")& "')"
Dim RS1
set RS1=server.createobject("adodb.recordset")
RS1.open SQL1, "dsn=mydb"
%>

SQL #2
SQL2="INSERT INTO table1(Y,Z) Values ("&_
"'"& request.form("Y")& "', " &_
"'"& request.form("Z")& "')"
Dim RS2
set RS2=server.createobject("adodb.recordset")
RS2.open SQL2, "dsn=mydb"
%>




QUOTE OF THE DAY
Not to know if bad; not to wish to know is worse.
<%
Jr Clown
%>
 
I forgot the <% below do this and you don't need the one between both SQL's
just at the top and bottom, but you knew that QUOTE OF THE DAY
Not to know if bad; not to wish to know is worse.
<%
Jr Clown
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top