新手,大家帮我。
目的,把timu中的记录添加到user中,然后把添加的这条记录从timu中删除。<%@ Language=VBScript %>
<%
dim name,xuehao,timu
dim sql,sql1
dim rs1,rs,rs2
name=request("txt1")
xuehao=request("txt2")
timu=request("select1")
set rs=server.createobject("adodb.recordset")
set rs1=server.createobject("adodb.recordset")
set rs2=server.createobject("adodb.recordset")
conn = "DBQ=" + server.mappath("mydb.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
sql1="delete from timu where timu.timu = user.timu"
sql="select * from user where xuehao='" & xuehao & "'"
rs.Open sql,conn,1,1
if rs.EOF then
sql="insert into user(username,timu,xuehao) values('"&name&"','"&timu&"','"&xuehao&"')"
rs1.Open sql,conn,1,1
session("name")=name
Response.Redirect "info.htm"
rs2.Open sql1,conn,1,1
Conn.Execute(sql1)
else
Response.Write "此用户已有人使用!"
end if
%>
麻烦大家帮我看看。