asp投票系统一

作者:袖梨 2022-07-02
 代码如下 复制代码

<%
Dim voteid, Choose, nowid, i, Rs,SQL
If Not IsObject(Conn) Then ConnectionDatabase

If IsNumeric(Request("voteid")) Then
 voteid = CLng(Request("voteid"))
Else
 voteid = 0
End If
If voteid = 0 Then
 SQL = "SELECT TOP 1 * FROM NC_Vote WHERE isLock<>1 ORDER BY id DESC"
Else
 SQL = "SELECT * FROM NC_Vote WHERE id="& voteid
End If
Set Rs = Conn.Execute(SQL)
If Rs.EOF Then
 Response.Write("连接数据发生错误")
 Response.End
Else
 For i = 1 To 5
  If IsNull(Rs("Choose_"&i)) Then Exit For
 Next

 nowid = Rs("id")

 Response.ContentType = "text/xml"
 'Response.Expires = -1
 Response.Write "<?xml version=""1.0"" encoding=""GB2312""?> " & vbNewLine
 Response.Write "" & vbNewLine
 Response.Write " " & vbNewLine
 Response.Write "  "
 Response.Write Rs("id")
 Response.Write "" & vbNewLine
 Response.Write "  "<br /> &nbsp;Response.Write Rs("Topic")<br /> &nbsp;Response.Write "" & vbNewLine
 Response.Write "  "
 Response.Write Rs("VoteNum")
 Response.Write "" & vbNewLine
 Response.Write "  "<br /> &nbsp;Response.Write Rs("bgcolor")<br /> &nbsp;Response.Write "" & vbNewLine
 Response.Write "  "<br /> &nbsp;Response.Write Rs("FontColor")<br /> &nbsp;Response.Write "" & vbNewLine
 Response.Write "  "
 Response.Write i - 1
 Response.Write "" & vbNewLine
 Response.Write "  "
 Response.Write Rs("FontSize")
 Response.Write "" & vbNewLine
 Response.Write "  "
 Response.Write CBool(Rs("VoteType"))
 Response.Write "" & vbNewLine
 Response.Write " " & vbNewLine

 For i = 2 To 6
  If IsNull(Rs(i)) Then Exit For
  Response.Write " " & vbNewLine
  Response.Write "  "<br /> &nbsp;&nbsp;Response.Write Rs(i)<br /> &nbsp;&nbsp;Response.Write "" & vbNewLine
  Response.Write "  "
  Response.Write Rs(i + 5)
  Response.Write "" & vbNewLine
  Response.Write " " & vbNewLine
 Next
End If
Rs.Close
Set Rs = Nothing
Response.Write " " & vbNewLine
Response.Write "  "
SQL = "SELECT * FROM NC_Vote WHERE id>"& nowid &" And isLock<>1"
Set Rs = Conn.Execute(SQL)
If Not (Rs.BOF And Rs.EOF) Then
 Response.Write Rs("id")
End If
Rs.Close
Set Rs = Nothing
Response.Write "" & vbNewLine
Response.Write "  

"
SQL = "SELECT * FROM NC_Vote WHERE id<"& nowid &" And isLock<>1 ORDER BY id DESC"
Set Rs = Conn.Execute(SQL)
If Not (Rs.BOF And Rs.EOF) Then
 Response.Write Rs("id")
End If
Rs.Close
Set Rs = Nothing
Response.Write "
" & vbNewLine
Response.Write " " & vbNewLine
Response.Write "" & vbNewLine

CloseConn
%>

相关文章

精彩推荐