欢迎来到天天文库
浏览记录
ID:18114552
大小:53.00 KB
页数:12页
时间:2018-09-14
《asp会员注册登录以及管理系统网页实例》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、asp会员注册登录以及管理系统网页实例本文由sy675859210贡献Result.asp(注册跳转结果,是否注册成功)Result.asp(注册跳转结果,是否注册成功)
2、op:0px;margin-bottom:0px;background-image:url();background-repeat:no-repeat;}body{background-color:#FFFFCC;}-->
3、gcolor="#FFCC99">&;nbsp;&;nbsp;&;nbsp;
<%'创建recordset对象方法1set
4、rst=Server.CreateObject("ADODB.recordset")rst.open"select*from[user]whereu_user='"&;request.form("f_user")&;"'",conn,1,1ifrst.recordcount>0then'如果从在这个用户名,对用户进行提示response.Write"用户名:"&;request.form("f_user")&;"已经被占用!请点击后退按钮返回上一页!"rst.closesetrst=nothingconn.
5、closesetconn=nothingresponse.Endelserst.closeconn.begintrans'开启数据库的事务功能rst.open"select*from[user]",conn,1,3rst.addnew'插入数据到user表rst("u_user")=request.Form("f_user")rst("u_code")=request.Form("f_code")rst.updaterst.close'获取刚才插入数据的自动编号字段值,即u_id字段的值setrst1=co
6、nn.execute("SELECT@@IDENTITYASuid")uid=rst1("uid")rst.open"info",conn,1,3'错误分析检测语句setmyErrors=conn.errorsifmyErrors.count>0thenfori=0tomyErrors.count-1response.Write("错误原因:"&;myErrors.item(i).description&;"")nextendif'错误分析检测结束iferr.number<>0thenresponse
7、.Write"ERR对象捕获错误:"&;err.descriptionendifrst.addnew'插入数据到info表rst("i_uid")=uidrst("i_name")=request.Form("f_name")rst("i_sex")=request.Form("f_sex")rst("i_age")=request.Form("f_age")rst("i_vip")=falserst.updaterst.closeiferr.number<>0thenconn.rollbacktrans'
8、取消之前写入数据库的内容(写入数据出错的情况下)%><%elseconn.committrans%>
请登录!!
此文档下载收益归作者所有