1个回答
展开全部
删除: 通过ID参数来删除数据库中指定ID的记录
<%
id=cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
sql="select id from biao where id="&id&""
rs.open(sql),cn,1,3
rs.delete
rs.close
set rs=nothing
response.Write "<script language='javascript'>alert('删除成功!');location.href='a.asp';</script>"
%>
添加:
act=Request("act")
If act="save" Then
name=trim(request.form("name"))
url=trim(request.form("url"))
time=now()
set rs=server.createobject("adodb.recordset"配运笑)
sql="select * from table"
rs.open(sql),cn,1,3
rs.addnew
rs("name")=name
rs("url")=url
rs("time")=time
rs.update
rs.close
set rs=nothing
response.Write "<script language='javascript'>alert('添加成功!');location.href='a.asp';</script>"
%>
修改:培含指定ID记录修改
act1=Request("act1")
If act1="save" Then
id=trim(request.form("悄敬l_id"))
name=trim(request.form("name"))
url=trim(request.form("url"))
set rs=server.createobject("adodb.recordset")
sql="select * from web_menu where id="&id&""
rs.open(sql),cn,1,3
rs("name")=name
rs("url")=url
rs.update
rs.close
set rs=nothing
response.Write "<script language='javascript'>alert('修改成功!');location.href='a.asp';</script>"
%>
<%
id=cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
sql="select id from biao where id="&id&""
rs.open(sql),cn,1,3
rs.delete
rs.close
set rs=nothing
response.Write "<script language='javascript'>alert('删除成功!');location.href='a.asp';</script>"
%>
添加:
act=Request("act")
If act="save" Then
name=trim(request.form("name"))
url=trim(request.form("url"))
time=now()
set rs=server.createobject("adodb.recordset"配运笑)
sql="select * from table"
rs.open(sql),cn,1,3
rs.addnew
rs("name")=name
rs("url")=url
rs("time")=time
rs.update
rs.close
set rs=nothing
response.Write "<script language='javascript'>alert('添加成功!');location.href='a.asp';</script>"
%>
修改:培含指定ID记录修改
act1=Request("act1")
If act1="save" Then
id=trim(request.form("悄敬l_id"))
name=trim(request.form("name"))
url=trim(request.form("url"))
set rs=server.createobject("adodb.recordset")
sql="select * from web_menu where id="&id&""
rs.open(sql),cn,1,3
rs("name")=name
rs("url")=url
rs.update
rs.close
set rs=nothing
response.Write "<script language='javascript'>alert('修改成功!');location.href='a.asp';</script>"
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询