一聚教程网:一个值得你收藏的教程网站

热门教程

asp投票系统一

时间:2022-07-02 22:44:16 编辑:袖梨 来源:一聚教程网

 代码如下 复制代码

<%
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 " " & vbNewLine
 Response.Write "" & vbNewLine
 Response.Write " " & vbNewLine
 Response.Write "  "
 Response.Write Rs("id")
 Response.Write "
" & vbNewLine
 Response.Write "    Response.Write Rs("Topic")
 Response.Write "]]>
" & vbNewLine
 Response.Write "  "
 Response.Write Rs("VoteNum")
 Response.Write "
" & vbNewLine
 Response.Write "    Response.Write Rs("bgcolor")
 Response.Write "]]>
" & vbNewLine
 Response.Write "    Response.Write Rs("FontColor")
 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 "     Response.Write Rs(i)
  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
%>

热门栏目