%
'FUNCTIONS TO SAVE THE SYSTEM FROM AN UNACCEPTABLE RUNOFF
Function AddFakeNominee(ComID)
AddFakeNominee = False
Dim strSQL
strSQL = "INSERT INTO VOTING_RESULTS(USERID, COMID, VOTES) VALUES"
strSQL = strSQL + "(" + CStr(999999) + ", " + CStr(ComID) + ", " + CStr(0) + ")"
Dim cmdAdd
Set cmdAdd = Server.CreateObject("ADODB.Command")
dbNVS.Open
cmdAdd.ActiveConnection = dbNVS
dbNVS.BeginTrans
cmdAdd.CommandText = strSQL
cmdAdd.Execute
'Error Handling in a small way...
If Err.Number > 0 then
'something is wrong...don't allow update to database...
dbNVS.RollBack
message = "A system error occured with the function DeleteVotingRecords." + _
"
Please click the BACK button."
Response.Clear
Response.Redirect "error.asp?mess=" + Server.URLEncode(message)
Response.End
AddFakeNominee = False
End if
dbNVS.CommitTrans
dbNVS.Close
set cmdAdd = Nothing
AddFakeNominee = True
End Function
Function GetPeeps(ComID, total_persons)%>
<%
Dim strSQL
strSQL = "SELECT Count(USER_ID) AS CNT FROM VOTED WHERE COMID = " + CStr(ComID)
dbNVS.Open
Set myRS = Server.CreateObject("ADODB.Recordset")
myRS.ActiveConnection = dbNVS
myRS.Open strSQL, dbNVS
If Err.Number <> 0 then
message = "A system error occured with the function GetNumVotes." + _
"
Please contact the Nominations and Election Committee " + _
"to resolve this problem.
Please click the back button."
Response.Clear
Response.Redirect "error.asp?mess=" + Server.URLEncode(message)
Response.End
End If
total_persons = Clng(myRS.Fields("CNT").Value)
Set myRS = Nothing
dbNVS.Close
End Function
%>