其他的都可以正常使用,,就是修改的时候修改完了出错,,,,
[此贴子已经被作者于2007-8-6 22:33:27编辑过]
其他的都可以正常使用,,就是修改的时候修改完了出错,,,,
[此贴子已经被作者于2007-8-6 22:33:27编辑过]
modify.asp
[QUOTE]<!--#include file="connk.asp"-->
<!--#include file="msg.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<%
dim sql
dim rs
dim id,user,password
id = request.querystring("id")
if not isnumeric(id) or id="" then
msg"非法操作"
else
if request.querystring("act")="modify" then
conn.execute("update [user] set [user]='"& user &"',password='"& password &"'")
msg "修改成功"
conn.close
set conn=nothing
else
set rs = server.createobject("adodb.recordset")
sql="select * from [user] where id="& id
rs.open sql,conn,1,1
if not rs.eof then
user = rs("user")
password = rs("password")
else
msg"记录不存在"
end if
rs.close
set rs =nothing
conn.close
set conn=nothing
end if
end if
%>
<body>
<form name="form1" method="post" action="modify.asp?act=modify&id=<%request.querystring("id")%>">
<table width="344" height="142" border="1" align="center">
<tr>
<td width="83" height="17">标题</td>
<td width="245"><input type="text" name="user" value="<%=user%>"></td>
</tr>
<tr>
<td>内容</td>
<td><textarea name="psw" cols="35" rows="10" ><%=password%></textarea> </td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="确定"></td>
</tr>
</table>
</form>
</body>
</html>[/QUOTE]
[此贴子已经被作者于2007-8-6 17:31:46编辑过]
<%
dim rs3
dim sql3
sql3="select * from user where id="&request.form("id")
set rs1=server.createobject("adodb.recordset")
if request.querystring("act")="go" then
if not isnumeric(request.querystring("id")) or request.querystring("id")="" then
msg"参数不正确"
else
rs3.open rs1,conn,1,3 大家,,还是不行啊,,这句话的问题 错误类型为:
microsoft vbscript 运行时错误(0x800a01a8)
缺少对象: ''
modify19行,,,就是这一行了
rs3("user")=request.form("user")
rs3("password")=request.form("psw")
rs3.update
end if
end if
%>
<%
dim sql
dim rs
set rs=server.createobject("adodb.recordset")
'rs.open conn
sql="select * from user where id="&request.querystring("id")
sql2="select * from user "
if request.querystring("act")="modify" then
if not isnumeric(request.QueryString("id")) or request.querystring("id")="" then
msg"非法操作"
else
rs.open sql,conn,1,1
end if
else
'rs.open sql2,conn,1,1
response.redirect "ad.asp"
end if
%>