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, adUseServer '*** Open the recordset
varTopic = Request.Form("topic") varTopicID = Request.Form("topicID") if varTopicID="" then varTopicID = Request.QueryString("topicID") end if varSelectionNum = Request.Form("selectionNum") varSelected = Request.Form("selected")
objRec3.Filter = 0 objRec3.Filter = "topicID=" & varTopicID 'only number can be filter?
If NOT objRec3.EOF then if Request.Form("selected") = "" then else varAlreadyVote="alreadyVote" & "_" & varTopicID if Session(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 %>