<%@ Language=VBScript %> <% 'Option Explicit %> <% ' ################################################# ' ### Declare and Set Variables ############## ' ################################################# Dim oConn,oRS, oRS2, strConn Dim strSec,strSec2,strSummary,strID dim strSQLSubMenu,strSQL,strSQLTot Dim bgColor, strPageType Dim strPerc Dim x strPollId = "2" strQuestID = Request.Querystring("questid") strAnsID = Request.Querystring("ansid") strSummary = Request.Querystring("sum") if strPollId = "" then strPollId ="2" 'response.write "admin - " & MSCSSite.AdminConnectionString & "
" 'response.write "default - " & MSCSSite.defaultconnectionString & "
" Set oConn = Server.CreateObject ("ADODB.Connection") Set oRS=Server.CreateObject("ADODB.Recordset") Set oRS2=Server.CreateObject("ADODB.Recordset") strConn = Application("liveConn") oConn.Open strConn if strQuestID ="" and strSummary <> "yes" then strSQL="select * from ubg_poll where fldPollID ='" & strPollId & "'" oRS.Open strSQL, oConn, 0, 1, 1 strPageType = "Home" end if if strQuestID <>"" and strSummary <> "yes" then strSQL= "select po.fldoptid ,po.fldpollid,po.fldquestid,po.fldOption, p.fldQuestion " strSQL= strSQL & "from ubg_polloptions as po, ubg_poll as p " strSQL= strSQL & "where po.fldPollID ='" & strPollId & "' and po.fldQuestID='" & strQuestID & "' " strSQL= strSQL & "and p.fldPollID ='" & strPollId & "' and p.fldQuestID='" & strQuestID & "'" 'strSQL="select * from ubg_polloptions where fldPollID ='2' and fldQuestID='" & strQuestID & "'" oRS.Open strSQL, oConn, 0, 1, 1 strPageType = "Question" end if if request.form.count>0 then if request.form("frmQuest") <> "" then strSQL = "Insert into UBG_PollAnswers (fldPollID,fldQuestID,fldAnswer) Values ('" & strPollId & "','" & request.form("frmQuestID") & "','" & request.form("frmQuest") & "')" end if oConn.Execute strSQL end if if strSummary ="yes" then strPageType = "Summary" end if 'response.write strSQL 'Set oRS = oConn.Execute(strSQL) %> THE ULTIMATE BOOK GUIDE

<% if strPageType = "Home" then %> Click on a link in the list below to view the options.

<% do while not oRS.EOF and not oRS.BOF %> " class="clsPollQuest"><%=oRS("fldQuestion")%>
<% oRS.MoveNext loop %>

View Poll Summary <% end if %> <% if strPageType = "Question" then %> <%=oRS("fldQuestion")%>
<% do while not oRS.EOF and not oRS.BOF %> "><%=oRS("fldOption")%>
<% oRS.MoveNext loop %>



Back to Poll Questions | View Poll Summary <% end if %> <% if strPageType = "Summary" then %> <% For x= 1 to 14 strSQL="select top 1 pa.fldquestid,p.fldquestion as quest,po.fldOption as opt, count(pa.fldquestid) as tot from ubg_pollanswers as pa " strSQL= strSQL & "inner join ubg_poll as p on pa.fldquestid = p.fldquestid and pa.fldpollid = p.fldpollid " strSQL= strSQL & "inner join ubg_polloptions as po on pa.fldanswer= po.fldoptid " strSQL= strSQL & "where pa.fldquestid='" & x & "' " strSQL= strSQL & " and pa.fldpollid='" & strPollId & "' " strSQL= strSQL & "group by pa.fldquestid,p.fldquestion,po.fldoption " strSQL= strSQL & "order by tot desc " oRS.Open strSQL, oConn, 0, 1, 1 strSQLTot = "select count(fldquestid) as tot from ubg_pollanswers where fldquestid='" & x & "' and fldpollid='" & strPollId & "' " oRS2.Open strSQLTot, oConn, 0, 1, 1 if not oRS.EOF and not oRS.BOF then strPerc = FormatPercent(Cint(oRS("tot"))/cint(oRS2("tot")),0)%> <% end if oRS.Close oRS2.Close next %>
<%=oRS("quest")%>
<%=oRS("opt")%>  
(<%=strPerc%>)


Back to Poll Questions <% end if %>

Home About the bookReviewsAuthorsArtworkQuizPollBuy the book