/research/top1000/poll/submit.asp
originally:
http://www.oclc.org/research/top1000/poll/submit.asp
Sorry, no iframe.
Voting results
Rank
Percent of vote
Title
Libraries' rank
<% '---- CursorTypeEnum Values ---- Const adOpenForwardOnly = 0 Const adOpenKeyset = 1 Const adOpenDynamic = 2 Const adOpenStatic = 3 '---- CursorOptionEnum Values ---- Const adHoldRecords = &H00000100 Const adMovePrevious = &H00000200 Const adAddNew = &H01000400 Const adDelete = &H01000800 Const adUpdate = &H01008000 Const adBookmark = &H00002000 Const adApproxPosition = &H00004000 Const adUpdateBatch = &H00010000 Const adResync = &H00020000 Const adNotify = &H00040000 Const adFind = &H00080000 '---- LockTypeEnum Values ---- Const adLockReadOnly = 1 Const adLockPessimistic = 2 Const adLockOptimistic = 3 Const adLockBatchOptimistic = 4 '---- ExecuteOptionEnum Values ---- Const adRunAsync = &H00000010 Const adAsyncExecute = &H00000010 Const adAsyncFetch = &H00000020 Const adAsyncFetchNonBlocking = &H00000040 Const adExecuteNoRecords = &H00000080 '---- ConnectOptionEnum Values ---- Const adAsyncConnect = &H00000010 '---- ObjectStateEnum Values ---- Const adStateClosed = &H00000000 Const adStateOpen = &H00000001 Const adStateConnecting = &H00000002 Const adStateExecuting = &H00000004 Const adStateFetching = &H00000008 '---- CursorLocationEnum Values ---- Const adUseServer = 2 Const adUseClient = 3 '---- DataTypeEnum Values ---- Const adEmpty = 0 Const adTinyInt = 16 Const adSmallInt = 2 Const adInteger = 3 Const adBigInt = 20 Const adUnsignedTinyInt = 17 Const adUnsignedSmallInt = 18 Const adUnsignedInt = 19 Const adUnsignedBigInt = 21 Const adSingle = 4 Const adDouble = 5 Const adCurrency = 6 Const adDecimal = 14 Const adNumeric = 131 Const adBoolean = 11 Const adError = 10 Const adUserDefined = 132 Const adVariant = 12 Const adIDispatch = 9 Const adIUnknown = 13 Const adGUID = 72 Const adDate = 7 Const adDBDate = 133 Const adDBTime = 134 Const adDBTimeStamp = 135 Const adBSTR = 8 Const adChar = 129 Const adVarChar = 200 Const adLongVarChar = 201 Const adWChar = 130 Const adVarWChar = 202 Const adLongVarWChar = 203 Const adBinary = 128 Const adVarBinary = 204 Const adLongVarBinary = 205 Const adChapter = 136 Const adFileTime = 64 Const adDBFileTime = 137 Const adPropVariant = 138 Const adVarNumeric = 139 '---- ParameterDirectionEnum Values ---- Const adParamUnknown = &H0000 Const adParamInput = &H0001 Const adParamOutput = &H0002 Const adParamInputOutput = &H0003 Const adParamReturnValue = &H0004 '---- CommandTypeEnum Values ---- Const adCmdUnknown = &H0008 Const adCmdText = &H0001 Const adCmdTable = &H0002 Const adCmdStoredProc = &H0004 Const adCmdFile = &H0100 Const adCmdTableDirect = &H0200 %> <% Const dictKey = 1 Const dictItem = 2 Dim objTitles Function SortDictionary(objDict,intSort) ' declare our variables Dim strDict() Dim objKey Dim strKey,strItem Dim X,Y,Z ' get the dictionary count Z = objDict.Count ' we need more than one item to warrant sorting If Z > 1 Then ' create an array to store dictionary information ReDim strDict(Z,2) X = 0 ' populate the string array For Each objKey In objDict strDict(X,dictKey) = objKey strDict(X,dictItem) = objDict(objKey) X = X + 1 Next ' perform a a shell sort of the string array For X = 0 to (Z - 2) For Y = X to (Z - 1) If (strDict(X,intSort) < strDict(Y,intSort)) Or _ ((strDict(X,intSort) = strDict(Y,intSort)) AND StrComp(objTitles(strDict(X,1)),objTitles(strDict(Y,1)), vbTextCompare) > 0) Then strKey = strDict(X,dictKey) strItem = strDict(X,dictItem) strDict(X,dictKey) = strDict(Y,dictKey) strDict(X,dictItem) = strDict(Y,dictItem) strDict(Y,dictKey) = strKey strDict(Y,dictItem) = strItem End If Next Next ' erase the contents of the dictionary object objDict.RemoveAll ' repopulate the dictionary with the sorted information For X = 0 to (Z - 1) objDict.Add strDict(X,dictKey), strDict(X,dictItem) Next End If End Function Dim intBook, strIP, strUnique, objDict, intVotes, objRank Dim objCommand, cnnSQL, rstDefault If Not IsNull(Request("book")) And IsNumeric(Cstr(Request("book"))) Then intBook = CInt(Request("book")) strIP = Request.ServerVariables("REMOTE_ADDR") strUnique = "" Set cnnSQL = Server.CreateObject("ADODB.Connection") cnnSQL.Open "WWW3_ORDERS","WWW3_ORDERS","&9a4ju#i8se!" Set objCommand = Server.CreateObject("ADODB.Command") objCommand.ActiveConnection = cnnSQL objCommand.CommandType = adCmdStoredProc objCommand.CommandTimeout = 120 objCommand.CommandText = "wwwTop1000InsertVote" objCommand.Parameters.Append _ objCommand.CreateParameter("@intBook", adInteger, adParamInput, 4, intBook) objCommand.Parameters.Append _ objCommand.CreateParameter("@strUnique", adVarChar, adParamInput, 10, strUnique) objCommand.Parameters.Append _ objCommand.CreateParameter("@strIP", adVarChar, adParamInput, 15, strIP) objCommand.Execute Set objCommand = nothing cnnSQL.Close Set cnnSQL = nothing End If ' See if we have the list in memory, if not, create it. ' Set objDict = Server.CreateObject("Scripting.Dictionary") Set objRank = Server.CreateObject("Scripting.Dictionary") Set objTitles = Server.CreateObject("Scripting.Dictionary") Set cnnSQL = Server.CreateObject("ADODB.Connection") cnnSQL.Open "WWW3_ORDERS","WWW3_ORDERS","&9a4ju#i8se!" ' Get list of titles ' Set objCommand = Server.CreateObject("ADODB.Command") Set rstDefault = Server.CreateObject("ADODB.RecordSet") objCommand.ActiveConnection = cnnSQL objCommand.CommandType = adCmdStoredProc objCommand.CommandTimeout = 120 objCommand.CommandText = "wwwTop1000GetBooks" rstDefault.Open objCommand, , adOpenStatic, adLockReadOnly Do While Not rstDefault.EOF if IsNull(rstDefault("strAuthor")) Or rstDefault("strAuthor") = "" Then objTitles.Add cint(rstDefault("intID")), "
" & cstr(rstDefault("strTitle")) & "
" Else objTitles.Add cint(rstDefault("intID")), "
" & cstr(rstDefault("strTitle")) & "
, by " & cstr(rstDefault("strAuthor")) End If objRank.Add cint(rstDefault("intID")), cint(rstDefault("intRank")) rstDefault.MoveNext Loop rstDefault.Close Set objCommand = nothing set rstDefault = nothing ' Get vote counts ' Set objCommand = Server.CreateObject("ADODB.Command") Set rstDefault = Server.CreateObject("ADODB.RecordSet") objCommand.ActiveConnection = cnnSQL objCommand.CommandType = adCmdStoredProc objCommand.CommandTimeout = 120 objCommand.CommandText = "wwwTop1000GetVotes" rstDefault.Open objCommand, , adOpenStatic, adLockReadOnly Do While Not rstDefault.EOF objDict.Add cint(rstDefault("intBook")), cint(rstDefault("intCount")) intVotes = intVotes + cint(rstDefault("intCount")) rstDefault.MoveNext Loop rstDefault.Close Set objCommand = nothing set rstDefault = nothing ' Sort results ' SortDictionary objDict, dictItem ' Output results %> <% Dim intCount For Each objKey In objDict intCount = intCount + 1 %>
#<%=cstr(intCount)%>
<%=cint((cint(objDict(objKey)) / intVotes) * 100)%>%
<%=cstr(objTitles(objKey))%>
#<%=cstr(objRank(objKey))%>
<% Next ' For Each objKey In objTitles ' ' If Not objDict.Exists(objKey) Then ' intCount = intCount + 1 ' '
'
#cstr(intCount)
'
0%
'
cstr(objTitles(objKey))
#cstr(objRank(objKey))
'
' ' End If ' Next %>