在一个asp处理页面中,能否如下这样同时向两个表中插入数据
<%dimvar1,var2,var3,var4,var5,var6var1=request.Form("identity")var2=request.Form("pre...
<%
dim var1,var2,var3,var4,var5,var6
var1=request.Form("identity")
var2=request.Form("prename")
var4=request.Form("sex")
var5=request.Form("telephone")
var6=request.Form("member_sort")
var7=request.Form("discount")
var8=request.Form("history_money")
dim sql:sql="insert into myPeople([identity],prename,[sex],[telephone]) values('"&var1&"','"&var2&"','"&var4&"','"&var5&"')"
dim sql2:sql2="insert into member([identity],prename,[sex],[telephone]) values('"&var1&"','"&var2&"','"&var4&"','"&var5&"')"
'response.Write sql
'response.Write sql2
'response.End()
conn.execute(sql)
conn.execute(sql2)
response.Redirect("people.asp")
%> 展开
dim var1,var2,var3,var4,var5,var6
var1=request.Form("identity")
var2=request.Form("prename")
var4=request.Form("sex")
var5=request.Form("telephone")
var6=request.Form("member_sort")
var7=request.Form("discount")
var8=request.Form("history_money")
dim sql:sql="insert into myPeople([identity],prename,[sex],[telephone]) values('"&var1&"','"&var2&"','"&var4&"','"&var5&"')"
dim sql2:sql2="insert into member([identity],prename,[sex],[telephone]) values('"&var1&"','"&var2&"','"&var4&"','"&var5&"')"
'response.Write sql
'response.Write sql2
'response.End()
conn.execute(sql)
conn.execute(sql2)
response.Redirect("people.asp")
%> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询