保存不了

kwx7903 2004-02-16 09:02:40
不知道怎么回事,就是保存不成功,请注意else段,因为调试表明运行了该段,但就是保存不了
If Session("Admin")="" or Session("usertype")<> 4Then
response.redirect "../default.asp"
else
'Session("Admin") = Session("Admin")
End If

'读取各字段的数据
id = Request("id")
username = Request("dlmc")
password = Request("password")
zhu = Request("zhu")
select case request("R1")
case "V1"
usertype="2"
case "V2"
usertype="3"
case "V3"
usertype="4"
end select
t_user=Application("Connection1_RuntimeUserName")
t_psw=Application("Connection1_RuntimePassword")
str_connection=Application("Connection1_ConnectionString")
On Error Resume Next
Err.Clear
Set conn = Server.CreateObject("ADODB.Connection")
Conn.CursorLocation =3
Conn.ConnectionTimeout = 30
Conn.CommandTimeout =15
'Conn.Open str_connection,t_user,t_psw
Conn.Open str_connection,t_user,t_psw
if err=0 then
'conn.Errors.Clear
else
Response.Write("<center><font color=#ff0000>连接数据库出错拉!!!</font></center>")
end if
Set rs_cc = Server.CreateObject("ADODB.Recordset")
sql_cc="select * from adm where ((id='"&trim(id)&"' or username='"&trim(username)&"') )"
rs_cc.Open sql_cc, conn, 1, 1
if not rs_cc.eof then
Response.Write "序号重复或用户已存在,请退回更正!"
rs_cc.close
conn.close
else

Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from adm where id="&id
rs.Open sql, conn, adOpenDynamic, adLockPessimistic
rs.AddNew

rs("id")=id
rs("username")=username
rs("password")=password
rs("usertype")=usertype
rs("zhu")=zhu

rs.Update


rs.close

conn.close

end if
...全文
50 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧