ASP中if和MSGbox问题

来源:百度知道 编辑:UC知道 时间:2024/06/15 01:16:08
<%
'创建RECORDSET对象方法1
set rst=Server.CreateObject("ADODB.recordset")
rst.open "select * from user where u_user='" & request.form("f_user") & "'",conn,1,1
if rst.recordcount>0 then
'如果存在这个用户名,对用户进行提示
response.write "用户名:" & request.form("f_user") & " 你已经申请过了!"
rst.close
set rst=nothing
conn.close
set conn=nothing
response.end
else
rst.close
conn.begintrans
rst.open "user",conn,1,3
rst.addnew'插入数据到user表
rst("u_user")=request.form("f_user")
rst("u_code")=request.form("f_code")
rst.update
rst.close
'获取刚才插入数据的自动编号字段值 ,即u_id字段的值
set rst1=conn.execute("SELECT @@IDENTITY AS uid")
uid=rst1("uid")
rst.open "info",conn,1,3
rst.addnew'插入数据到info表
rst("i_

Dim MyVar
MyVar = MsgBox ("恭喜您,你已完成注册!", 0, "MsgBox Example")
'***********************
'后面这句:
document.write MyVar
'或
MsgBox ("恭喜您,你已完成注册!", 0, "MsgBox Example")
'**********************

document.location="http://dnf.qq.com/index.shtml"
你测试下