手机版

asp连接数据库代码实例(5)

时间:2025-05-10   来源:未知    
字号:

asp 连接数据库代码实例

conn.close

response.write\"<script language=\'javascript\'>alert(\'所有信息已成功删除!\');location.href(\'?action=manage\');</script>\"

end if

if request(\"action\")=\"saveedit\" then

name=request.form(\"name\")

hits=request.form(\"hits\")

content=request.form(\"content\")

set rs=server.createobject(\"adodb.recordset\")

sql=\"select * from biao where id=\"&request(\"id\")&\"\"

rs.open sql,conn,3,2

rs(\"name\")=name

rs(\"content\")=content

rs(\"hits\")=hits

rs.update

conn.close

set rs=nothing

response.write \"<script language=javascript>alert(\'编辑成功!\');location.href(\'?id=\"&request(\"id\")&\"&action=edit\');</script>\"

end if

%>

---------------------------------

5。查询纪录

<form name="form1" method="post" action="search.asp">

<input name="keyword" type="text" id="keyword" size="25">

<select name="select" size="1">

<option value="name" selected>名称</option>

<option value="content">说明</option>

<option value="id">id</option>

</select>

<input type="submit" name="Submit" value="查询">

</form>

------search.asp---------------

<%

if request("keyword")<>"" and request("select")<>"" then

sql="select * from biao where "&request("select")&" like '%"&request("keyword")&"%'"

elseif request("keyword")<>"" and request("select")="all" then

sql="select * from biao where name like '%"&request("keyword")&"%' or id like '%"&request("keyword")&"%' or content like '%"&request("keyword")&"%'"

asp连接数据库代码实例(5).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
×
二维码
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)