⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sql.asp

📁 if you want it,call me.
💻 ASP
字号:
<!--#include file="conn.asp"-->
<% 
dim action
action=Trim(Request.QueryString("action"))
dim rs
dim sql
set rs=Server.CreateObject("adodb.recordset")
if action="user" then
	call user()
elseif action="title" then
	call title()
elseif action="voteadd" then
	call voteadd()
elseif action="votemotify" then
	call votemotify()
elseif action=0 then
	call re()
else
	response.Redirect "vote.asp"
end if

'-------------用户信息修改-------------------
sub user()
sql="select * from admin"
rs.open sql,conn,1,3
rs("user")=Trim(Request.Form("user"))
rs("password")=Trim(Request.Form("password"))
rs.update
rs.close
	response.Redirect "vote.asp"
end sub
'---------------------------------------------
'----------------修改投票主题-------------------
sub title()
sql="select * from title"
rs.open sql,conn,1,3
rs("title")=Trim(Request.Form("title"))
rs.update
rs.close
	response.Redirect "vote.asp"
end sub
'-----------------------------------------------
'------------------增加投票项目---------------------
sub voteadd()
sql="select * from vote"
rs.open sql,conn,1,3
rs.addnew
rs("name")=Trim(Request.Form("name"))
rs.update
rs.close
	response.Redirect "vote.asp"
end sub
'-------------------------------------------------
'------------------投票项目修改,删除-----------------
sub votemotify()
dim id
dim submit
dim newname
dim oldname
submit=Trim(Request("submit"))
id=Trim(Request.QueryString("id"))
newname=Trim(Request.Form("newname"))
oldname=Trim(Request.Form("oldname"))
if submit="修改" then
sql="select * from vote where name='"&oldname&"'"
rs.open sql,conn,1,3
rs("name")=newname
rs.update
rs.close
end if
if submit="删除" then
sql="delete from vote where name='"&oldname&"'"
conn.execute sql
end if
if submit="计数置0" then
sql="select * from vote where name='"&oldname&"'"
rs.open sql,conn,1,3
rs("votenum")=0
rs.update
end if
	response.Redirect "vote.asp"
end sub
'---------------------------------------------------
'-----------------投票归0------------------
sub re()
sql="select * from vote"
rs.open sql,conn,1,3
do while not rs.eof
rs("votenum")=0
rs.update
rs.movenext
loop
rs.close
	response.Redirect "vote.asp"
end sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -