<%
dim id
If trim(Request.QueryString("id"))="" then
id=trim(Request.ServerVariables("HTTP_REFERER"))
else
id=trim(Request.QueryString("id"))
end if
If Request.QueryString("save")=1 then
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * FROM top_index WHERE id="&id
rs.open sql,conn,1,3
rs("id")= Request("id")
rs("qu")=qu
rs("name")=name
rs("www")=qu
rs.update
rs.close
response.Redirect "top_s.asp"
%>
改为
<%
dim id2
If trim(Request.QueryString("id"))="" then
id2=trim(Request.ServerVariables("HTTP_REFERER"))
else
id2=trim(Request.QueryString("id"))
end if
If Request.QueryString("save")=1 then
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * FROM top_index WHERE id="&id2
rs.open sql,conn,1,3
rs.addnew
rs("id")= Request("id")
rs("qu")=qu
rs("name")=name
rs("www")=qu
rs.update
rs.close
response.Redirect "top_s.asp"
%>
是找错吗?
是啊,问题是什么?说得明确点啊
rs.open sql,conn,1,3
rs("id")= Request("id")
这两行之间要加一行rs.addnew:
rs.open sql,conn,1,3
rs.addnew
rs("id")= Request("id")