日期:2014-05-16 浏览次数:20640 次
<!-- #include file="adoconn.asp" -->
<%
'=========================================
'功能:ajax实现无刷新对数据库的操作
'有添加、删除、修改、分页
'使用的是jquery框架
'作者:wangsdong
'来源:www.aspprogram.cn
'友情下载:脚本之家(http://www.jb51.net)
'文章为作者原创,转载请注明文章出处、保留作
'者信息,谢谢支持!
'=========================================
'此为后台文件
Response.CacheControl = "no-cache"
response.addheader"content-type","text/html;charset=gb2312"
id=request("id")
set rs=server.CreateObject("adodb.recordset")
act=request("act")
if act="" or act="add" then
call add()
elseif act="list" then
call manage()
elseif act="del" then
call del()
elseif act="modify" then
call modify()
ElseIf act="edit" Then
Call edit()
end If
sub del() '删除
page=request("page")
sql="delete from shuisheng where object_id="&id
conn.execute(sql)
Call manage()
end sub
sub add() '添加
ph = VbsUnEscape(request("ph"))
imagee = request("imagee")
qita = request("qita")
sql="select * from shuisheng where object_id=null"
rs.open sql,conn,1,3
rs.addnew
rs("ph")=ph
rs("imagee")=imagee
rs.update
rs.close
Call manage()
end sub
sub manage() '分页
%>
<%
sql="select object_id,ph,imagee from shuisheng order by object_id desc"
rs.open sql,conn,1,1
k=