Yarrokon
04-08-2009, 08:11 PM
Hello,
This is an odd one that I've never seen before, and I have the same bit of code in two seperate pages with different DB calls, one works and the other tosses this error. I've done a little research via Google but am not fully understanding what I am doing wrong.
In using Dreamweaver (Yes, I know smack me) I've even tried calling some of the var's that reset the record position and at that point the error is fixed, but nothing displays on the page. :-)
Code in Question
<%
' Builds a total of all Records Count Field to create a Percentage Value.
Dim numOne
Dim numTwo
Dim numTotal
qCount = (RS_GetPollF.Fields.Item("qCount").Value)
Do While Not RS_GetPollF.EOF
numOne = qCount
numTwo = numTwo + numOne
RS_GetPollF.MoveNext()
Loop
numTotal = numTwo
RS_GetPollF.MoveFirst()
%>
Failing Page Code
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="BLAH" -->
<%
Dim RS_GetPollF__valFemale
RS_GetPollF__valFemale = "2"
If (Request.QueryString("qpollID") <> "") Then
RS_GetPollF__valFemale = Request.QueryString("qpollID")
End If
%>
<%
Dim RS_GetPollF
Dim RS_GetPollF_cmd
Dim RS_GetPollF_numRows
Set RS_GetPollF_cmd = Server.CreateObject ("ADODB.Command")
RS_GetPollF_cmd.ActiveConnection = MM_pollConn_STRING
RS_GetPollF_cmd.CommandText = "SELECT pollNames.pollName, pollQuestions.qText, pollQuestions.qGender, pollQuestions.qCount FROM pollNames Inner Join pollQuestions ON pollQuestions.qpollID = pollNames.pollID WHERE pollQuestions.qGender = 'Female' AND qpollID = ?"
RS_GetPollF_cmd.Prepared = true
RS_GetPollF_cmd.Parameters.Append RS_GetPollF_cmd.CreateParameter("param1", 5, 1, -1, RS_GetPollF__valFemale) ' adDouble
Set RS_GetPollF = RS_GetPollF_cmd.Execute
RS_GetPollF_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
RS_GetPollF_numRows = RS_GetPollF_numRows + Repeat1__numRows
%>
<%
' Builds a total of all Records Count Field to create a Percentage Value.
Dim numOne
Dim numTwo
Dim numTotal
qCount = (RS_GetPollF.Fields.Item("qCount").Value)
Do While Not RS_GetPollF.EOF
numOne = qCount
numTwo = numTwo + numOne
RS_GetPollF.MoveNext()
Loop
numTotal = numTwo
RS_GetPollF.MoveFirst()
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Filter By Female</title>
<link href="/Testing/assets/css/poll.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p><a href="/Testing">‹ Back</a></p>
<h1>Filter Poll by Female</h1>
<% If Not RS_GetPollF.EOF Or Not RS_GetPollF.BOF Then %>
<table border="0" cellpadding="3" cellspacing="0">
<tr>
<td><h4>pollName</h4></td>
<td><h4>qText</h4></td>
<td><h4>qGender</h4></td>
<td><h4>qCount</h4></td>
<td><h4>%</h4></td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT RS_GetPollF.EOF)) %>
<tr>
<td><%=(RS_GetPollF.Fields.Item("pollName").Value)%></td>
<td><%=(RS_GetPollF.Fields.Item("qText").Value)%></td>
<td><%=(RS_GetPollF.Fields.Item("qGender").Value)%></td>
<td><%=(qCount)%></td>
<td><%=Response.Write(FormatPercent(qCount/numTotal,1))%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
RS_GetPollF.MoveNext()
Wend
%>
<tr>
<td> </td>
<td> </td>
<td align="right">Total:</td>
<td><%= Response.Write(numTotal) %></td>
<td> </td>
</tr>
</table>
<% End If ' end Not RS_GetPollF.EOF Or NOT RS_GetPollF.BOF %>
<% If RS_GetPollF.EOF And RS_GetPollF.BOF Then %>
<p>No Data in your Request Tono...</p>
<% End If ' end RS_GetPollF.EOF And RS_GetPollF.BOF %>
</body>
</html>
<%
RS_GetPollF.Close()
Set RS_GetPollF = Nothing
%>
Working Page
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="BLAH" -->
<%
Dim getIT
Dim getIT_cmd
Dim getIT_numRows
Set getIT_cmd = Server.CreateObject ("ADODB.Command")
getIT_cmd.ActiveConnection = MM_PhxNowDB_STRING
getIT_cmd.CommandText = "SELECT * FROM phxnowdb.counting"
getIT_cmd.Prepared = true
Set getIT = getIT_cmd.Execute
getIT_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
getIT_numRows = getIT_numRows + Repeat1__numRows
%>
<%
' Builds a total of all Records Count Field to create a Percentage Value.
dim numOne, numTwo, numTotal
do while not getIT.EOF
numOne = (getIT.Fields.Item("qCount").Value)
numTwo = numTwo + numOne
getIT.MoveNext()
loop
numTotal = numTwo
getIt.MoveFirst()
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>
<body>
<table width="250" border="0" cellpadding="3" cellspacing="1">
<tr>
<td bgcolor="#666666"><span class="style1">Player</span></td>
<td bgcolor="#666666"><span class="style1">Name</span></td>
<td bgcolor="#666666"><span class="style1">Score</span></td>
<td bgcolor="#666666"><span class="style1">Percent</span></td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT getIT.EOF)) %>
<tr>
<td bgcolor="#EFEFEF"><%=(getIT.Fields.Item("qID").Value)%></td>
<td bgcolor="#EFEFEF"><%=(getIT.Fields.Item("qName").Value)%></td>
<td align="right" bgcolor="#EFEFEF"><%=(getIT.Fields.Item("qCount").Value)%></td>
<td align="right" bgcolor="#EFEFEF"><%=Response.Write(FormatPercent(getIT.Fields.Item("qCount").Value/numTotal,1))%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
getIT.MoveNext()
Wend
%>
<tr>
<td> </td>
<td align="right" bgcolor="#EFEFEF">Total:</td>
<td bgcolor="#666666"><span class="style1"><%=Response.Write(numTotal)%></span></td>
<td> </td>
</tr>
</table>
</body>
</html>
<%
getIT.Close()
Set getIT = Nothing
%>
As normal, any information would be wonderful, if not an answer then maybe some tips on troubleshooting this type of issue.
Thank You!
This is an odd one that I've never seen before, and I have the same bit of code in two seperate pages with different DB calls, one works and the other tosses this error. I've done a little research via Google but am not fully understanding what I am doing wrong.
In using Dreamweaver (Yes, I know smack me) I've even tried calling some of the var's that reset the record position and at that point the error is fixed, but nothing displays on the page. :-)
Code in Question
<%
' Builds a total of all Records Count Field to create a Percentage Value.
Dim numOne
Dim numTwo
Dim numTotal
qCount = (RS_GetPollF.Fields.Item("qCount").Value)
Do While Not RS_GetPollF.EOF
numOne = qCount
numTwo = numTwo + numOne
RS_GetPollF.MoveNext()
Loop
numTotal = numTwo
RS_GetPollF.MoveFirst()
%>
Failing Page Code
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="BLAH" -->
<%
Dim RS_GetPollF__valFemale
RS_GetPollF__valFemale = "2"
If (Request.QueryString("qpollID") <> "") Then
RS_GetPollF__valFemale = Request.QueryString("qpollID")
End If
%>
<%
Dim RS_GetPollF
Dim RS_GetPollF_cmd
Dim RS_GetPollF_numRows
Set RS_GetPollF_cmd = Server.CreateObject ("ADODB.Command")
RS_GetPollF_cmd.ActiveConnection = MM_pollConn_STRING
RS_GetPollF_cmd.CommandText = "SELECT pollNames.pollName, pollQuestions.qText, pollQuestions.qGender, pollQuestions.qCount FROM pollNames Inner Join pollQuestions ON pollQuestions.qpollID = pollNames.pollID WHERE pollQuestions.qGender = 'Female' AND qpollID = ?"
RS_GetPollF_cmd.Prepared = true
RS_GetPollF_cmd.Parameters.Append RS_GetPollF_cmd.CreateParameter("param1", 5, 1, -1, RS_GetPollF__valFemale) ' adDouble
Set RS_GetPollF = RS_GetPollF_cmd.Execute
RS_GetPollF_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
RS_GetPollF_numRows = RS_GetPollF_numRows + Repeat1__numRows
%>
<%
' Builds a total of all Records Count Field to create a Percentage Value.
Dim numOne
Dim numTwo
Dim numTotal
qCount = (RS_GetPollF.Fields.Item("qCount").Value)
Do While Not RS_GetPollF.EOF
numOne = qCount
numTwo = numTwo + numOne
RS_GetPollF.MoveNext()
Loop
numTotal = numTwo
RS_GetPollF.MoveFirst()
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Filter By Female</title>
<link href="/Testing/assets/css/poll.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p><a href="/Testing">‹ Back</a></p>
<h1>Filter Poll by Female</h1>
<% If Not RS_GetPollF.EOF Or Not RS_GetPollF.BOF Then %>
<table border="0" cellpadding="3" cellspacing="0">
<tr>
<td><h4>pollName</h4></td>
<td><h4>qText</h4></td>
<td><h4>qGender</h4></td>
<td><h4>qCount</h4></td>
<td><h4>%</h4></td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT RS_GetPollF.EOF)) %>
<tr>
<td><%=(RS_GetPollF.Fields.Item("pollName").Value)%></td>
<td><%=(RS_GetPollF.Fields.Item("qText").Value)%></td>
<td><%=(RS_GetPollF.Fields.Item("qGender").Value)%></td>
<td><%=(qCount)%></td>
<td><%=Response.Write(FormatPercent(qCount/numTotal,1))%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
RS_GetPollF.MoveNext()
Wend
%>
<tr>
<td> </td>
<td> </td>
<td align="right">Total:</td>
<td><%= Response.Write(numTotal) %></td>
<td> </td>
</tr>
</table>
<% End If ' end Not RS_GetPollF.EOF Or NOT RS_GetPollF.BOF %>
<% If RS_GetPollF.EOF And RS_GetPollF.BOF Then %>
<p>No Data in your Request Tono...</p>
<% End If ' end RS_GetPollF.EOF And RS_GetPollF.BOF %>
</body>
</html>
<%
RS_GetPollF.Close()
Set RS_GetPollF = Nothing
%>
Working Page
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="BLAH" -->
<%
Dim getIT
Dim getIT_cmd
Dim getIT_numRows
Set getIT_cmd = Server.CreateObject ("ADODB.Command")
getIT_cmd.ActiveConnection = MM_PhxNowDB_STRING
getIT_cmd.CommandText = "SELECT * FROM phxnowdb.counting"
getIT_cmd.Prepared = true
Set getIT = getIT_cmd.Execute
getIT_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
getIT_numRows = getIT_numRows + Repeat1__numRows
%>
<%
' Builds a total of all Records Count Field to create a Percentage Value.
dim numOne, numTwo, numTotal
do while not getIT.EOF
numOne = (getIT.Fields.Item("qCount").Value)
numTwo = numTwo + numOne
getIT.MoveNext()
loop
numTotal = numTwo
getIt.MoveFirst()
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>
<body>
<table width="250" border="0" cellpadding="3" cellspacing="1">
<tr>
<td bgcolor="#666666"><span class="style1">Player</span></td>
<td bgcolor="#666666"><span class="style1">Name</span></td>
<td bgcolor="#666666"><span class="style1">Score</span></td>
<td bgcolor="#666666"><span class="style1">Percent</span></td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT getIT.EOF)) %>
<tr>
<td bgcolor="#EFEFEF"><%=(getIT.Fields.Item("qID").Value)%></td>
<td bgcolor="#EFEFEF"><%=(getIT.Fields.Item("qName").Value)%></td>
<td align="right" bgcolor="#EFEFEF"><%=(getIT.Fields.Item("qCount").Value)%></td>
<td align="right" bgcolor="#EFEFEF"><%=Response.Write(FormatPercent(getIT.Fields.Item("qCount").Value/numTotal,1))%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
getIT.MoveNext()
Wend
%>
<tr>
<td> </td>
<td align="right" bgcolor="#EFEFEF">Total:</td>
<td bgcolor="#666666"><span class="style1"><%=Response.Write(numTotal)%></span></td>
<td> </td>
</tr>
</table>
</body>
</html>
<%
getIT.Close()
Set getIT = Nothing
%>
As normal, any information would be wonderful, if not an answer then maybe some tips on troubleshooting this type of issue.
Thank You!