Vote.asp
<% @ Language = "VBScript"%>
<% OPTION Explicit%>
<% Response.buffer = true%>
<%
'*** Remember to create Those Variables Before Trying to use.
DIM Objconn
DIM ObjRec3
DIM STRCONNECT
DIM VARTOPIC, VARTOPICID, VARSELECTED, VARSELECTED
DIM I, Vartotal, Varthis, Varthistitle, VaralReadyvote
StrConnect = "driver = {Microsoft Access Driver (* .mdb)}; dbq =" & Server.mappath ("vote.mdb") & "; defaultdir =" & Server.mappath (".") & "; driverid = 25; file = MS Access; maxbuffersize = 512; pagetimeout = 5; saFetransactions = 0; threads = 3; uid = admin; usercommitsync = yes ;; user ID = admin; "
Set objconn = server.createObject ("adoDb.connection") '*** Create An Ado Database Connection Object.
Set objRec3 = server.createObject ("adoDb.recordset") '** Create An ado recordset Object.
Objconn.open strconnect '*** Open the connection to the database
Objrec3.open "vote", Objconn, AdopenForwardonly, AdlockPESSIMISTIC, ADUSERVER '*** Open the Recordset
VARTOPIC = Request.form ("Topic")
VARTOPICID = Request.form ("TopiciD")
IF VARTOPICID = "" "" "
VARTOPICID = Request.QueryString ("TopicID")
END IF
VarselectionNum = Request.form ("SelectionNum")
Varselected = Request.form ("SELECTED")
ObjRec3.filter = 0
Objrec3.filter = "Topicid =" & VARTOPIPIPID 'Only Number Can Be Filter?
IF not objrec3.eof then
If Request.form ("SELECTED") = "" ""
Else
VaralReadyvote = "Alreadyvote" & "VaralReadyvote <>" True "THEN
Objrec3 ("Selection" & varselected & "_count") = objrec3 ("Selection & Varselected &" _count ") 1
ObjRec3.update
Session (VaralReadyvote) = "True"
END IF
END IF
Vartotal = 0
For i = 0 to objRec3 ("SelectionNum") - 1
Vartotal = Vartotal ObjRec3 ("Selection" & I & "_COUNT")
NEXT
%>
<% = varopic%> P>
|