|
 |
asp_web_howto thread: Recordset Sizes
Message #1 by "John Eix" <jeix@s...> on Tue, 30 Jul 2002 22:45:33 -0400
|
|
Hi
My problem is this, I use a script to select recordsets of between 4 and
200 records from an Access database, the script that uses the resulting
recordset works fine for the recordsets of 4 to 25 records but the same
script does not work for record set of 200 records. Here is the script I
am using for the selection and comparison
=================Script=========================
' create the SQL string
strSQL ="SELECT * " & "FROM IB "
strSQL = strSQL & "WHERE unit = '" & Session("QuizName")
& "'"
strSQL = strSQL & " ORDER BY ItemNum"
' create the recordset object
Set rsQuiz = Server.CreateObject ("ADODB.Recordset")
' now open it
rsQuiz.open strSQL, strconnect, adOpenStatic,
adLockReadOnly, adCmdText
rsQuiz.MoveFirst
'now compare the right answers in the recordset with
those stored in strAnswers
iScore = 0
I = 1
Do While I =< iNumberOfQuestions
If UCase(CStr(rsQuiz.Fields("Answer").Value))
GetAnswerFromAnswerString(I, strAnswers) Then
Response.write
UCase(CStr(rsQuiz.Fields("Answer").Value))
Response.write
GetAnswerFromAnswerString(I, strAnswers)
Response.write iScore
iScore = iScore + 1
Else
strResults = strResults & I & ",
"
End If
I = I + 1
rsQuiz.MoveNext
Loop
' Close and dispose of our DB objects
rsQuiz.Close
Set rsQuiz = Nothing
=====================Script Ends========================
As I said this script works fine for small recordsets but the debugging
statements "Response.write UCase(CStr(rsQuiz.Fields("Answer").Value))
Response.write GetAnswerFromAnswerString(I, strAnswers)" show nothing
when the 200 record recordset is used???? I have checked and displayed
the rsQuiz recordset for small and large recordsets and have made sure
that all the variables have the appropriate values. I do not understand
why the comparison "If UCase(CStr(rsQuiz.Fields("Answer").Value))
GetAnswerFromAnswerString(I, strAnswers)" does not work for the large
recordset. I first thought that maybe the "Answers" for the large
recordset were somehow formatted differently but I don't see how that
could be possible the field in the database is text. Thank you for your
responses
.........................................
John Eix ]8-)
E-mail: jeix@s...
ECS web site: http://eix.dyndns.org/
The Twin's web site http://eix.dyndns.org/twins/
Holly's web site http://eix.dyndns.org/holly/
ChemEd Trading Post: http://eix.dyndns.org/tp/
Hamilton-Niagara Conference: http://eix.dyndns.org/hnc/
Mobile Phone: xxx-xxx-xxxx
Phone: xxx-xxx-xxxx
Eix Consulting Services
1345 Kensington Pk Rd
OAKVILLE, ON
L6H 2G8
Message #2 by "TomMallard" <mallard@s...> on Wed, 31 Jul 2002 08:31:09 -0700
|
|
Can you post the code for GetAnswerFromAnswerString(I, strAnswers)?
tom mallard
seattle
-----Original Message-----
From: John Eix [mailto:jeix@s...]
Sent: Tuesday, July 30, 2002 7:46 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Recordset Sizes
Hi
My problem is this, I use a script to select recordsets of between 4 and
200 records from an Access database, the script that uses the resulting
recordset works fine for the recordsets of 4 to 25 records but the same
script does not work for record set of 200 records. Here is the script I
am using for the selection and comparison
=================Script=========================
' create the SQL string
strSQL ="SELECT * " & "FROM IB "
strSQL = strSQL & "WHERE unit = '" & Session("QuizName")
& "'"
strSQL = strSQL & " ORDER BY ItemNum"
' create the recordset object
Set rsQuiz = Server.CreateObject ("ADODB.Recordset")
' now open it
rsQuiz.open strSQL, strconnect, adOpenStatic,
adLockReadOnly, adCmdText
rsQuiz.MoveFirst
'now compare the right answers in the recordset with
those stored in strAnswers
iScore = 0
I = 1
Do While I =< iNumberOfQuestions
If UCase(CStr(rsQuiz.Fields("Answer").Value))
GetAnswerFromAnswerString(I, strAnswers) Then
Response.write
UCase(CStr(rsQuiz.Fields("Answer").Value))
Response.write
GetAnswerFromAnswerString(I, strAnswers)
Response.write iScore
iScore = iScore + 1
Else
strResults = strResults & I & ",
"
End If
I = I + 1
rsQuiz.MoveNext
Loop
' Close and dispose of our DB objects
rsQuiz.Close
Set rsQuiz = Nothing
=====================Script Ends========================
As I said this script works fine for small recordsets but the debugging
statements "Response.write UCase(CStr(rsQuiz.Fields("Answer").Value))
Response.write GetAnswerFromAnswerString(I, strAnswers)" show nothing
when the 200 record recordset is used???? I have checked and displayed
the rsQuiz recordset for small and large recordsets and have made sure
that all the variables have the appropriate values. I do not understand
why the comparison "If UCase(CStr(rsQuiz.Fields("Answer").Value))
GetAnswerFromAnswerString(I, strAnswers)" does not work for the large
recordset. I first thought that maybe the "Answers" for the large
recordset were somehow formatted differently but I don't see how that
could be possible the field in the database is text. Thank you for your
responses
.........................................
John Eix ]8-)
E-mail: jeix@s...
ECS web site: http://eix.dyndns.org/
The Twin's web site http://eix.dyndns.org/twins/
Holly's web site http://eix.dyndns.org/holly/
ChemEd Trading Post: http://eix.dyndns.org/tp/
Hamilton-Niagara Conference: http://eix.dyndns.org/hnc/
Mobile Phone: xxx-xxx-xxxx
Phone: xxx-xxx-xxxx
Eix Consulting Services
1345 Kensington Pk Rd
OAKVILLE, ON
L6H 2G8
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
Message #3 by "John Eix" <jeix@s...> on Wed, 31 Jul 2002 12:12:15 -0400
|
|
Here is the code for the function
==============Code====================
Function GetAnswerFromAnswerString(iQuestionNumber, strAnswers)
Dim strTemp
Dim iOffset
' I use InStrRev since I want to retrieve the last entered value
' in case they went back and changed their mind.
' Find the location of the question number we want to use
iOffset = InStrRev(strAnswers, "|" & iQuestionNumber & "|", -1,
1)
' Get our answer by using the offset we just found and then
moving
' right the length of the question indicator to arrive at the
' appropriate letter
strTemp = Mid(strAnswers, iOffset + Len("|" & iQuestionNumber &
"|"), 1)
' There's no way it should be anything else, but to be sure we
' convert it to a string and make sure it's uppercase
GetAnswerFromAnswerString = UCase(CStr(strTemp))
End Function
===============End of Code======================
Thanks!
-----Original Message-----
From: TomMallard [mailto:mallard@s...]
Sent: July 31, 2002 11:31
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Recordset Sizes
Can you post the code for GetAnswerFromAnswerString(I, strAnswers)?
tom mallard
seattle
-----Original Message-----
From: John Eix [mailto:jeix@s...]
Sent: Tuesday, July 30, 2002 7:46 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Recordset Sizes
Hi
My problem is this, I use a script to select recordsets of between 4 and
200 records from an Access database, the script that uses the resulting
recordset works fine for the recordsets of 4 to 25 records but the same
script does not work for record set of 200 records. Here is the script I
am using for the selection and comparison
=================Script=========================
' create the SQL string
strSQL ="SELECT * " & "FROM IB "
strSQL = strSQL & "WHERE unit = '" & Session("QuizName")
& "'"
strSQL = strSQL & " ORDER BY ItemNum"
' create the recordset object
Set rsQuiz = Server.CreateObject ("ADODB.Recordset")
' now open it
rsQuiz.open strSQL, strconnect, adOpenStatic,
adLockReadOnly, adCmdText
rsQuiz.MoveFirst
'now compare the right answers in the recordset with
those stored in strAnswers
iScore = 0
I = 1
Do While I =< iNumberOfQuestions
If UCase(CStr(rsQuiz.Fields("Answer").Value))
GetAnswerFromAnswerString(I, strAnswers) Then
Response.write
UCase(CStr(rsQuiz.Fields("Answer").Value))
Response.write
GetAnswerFromAnswerString(I, strAnswers)
Response.write iScore
iScore = iScore + 1
Else
strResults = strResults & I & ",
"
End If
I = I + 1
rsQuiz.MoveNext
Loop
' Close and dispose of our DB objects
rsQuiz.Close
Set rsQuiz = Nothing
=====================Script Ends========================
As I said this script works fine for small recordsets but the debugging
statements "Response.write UCase(CStr(rsQuiz.Fields("Answer").Value))
Response.write GetAnswerFromAnswerString(I, strAnswers)" show nothing
when the 200 record recordset is used???? I have checked and displayed
the rsQuiz recordset for small and large recordsets and have made sure
that all the variables have the appropriate values. I do not understand
why the comparison "If UCase(CStr(rsQuiz.Fields("Answer").Value))
GetAnswerFromAnswerString(I, strAnswers)" does not work for the large
recordset. I first thought that maybe the "Answers" for the large
recordset were somehow formatted differently but I don't see how that
could be possible the field in the database is text. Thank you for your
responses
.........................................
John Eix ]8-)
E-mail: jeix@s...
ECS web site: http://eix.dyndns.org/
The Twin's web site http://eix.dyndns.org/twins/
Holly's web site http://eix.dyndns.org/holly/
ChemEd Trading Post: http://eix.dyndns.org/tp/
Hamilton-Niagara Conference: http://eix.dyndns.org/hnc/
Mobile Phone: xxx-xxx-xxxx
Phone: xxx-xxx-xxxx
Eix Consulting Services
1345 Kensington Pk Rd
OAKVILLE, ON
L6H 2G8
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
Message #4 by "TomMallard" <mallard@s...> on Wed, 31 Jul 2002 11:48:53 -0700
|
|
Since this is server-side, I think the way to get around the performance
bottleneck is not to use string manipulations, that's what's killing it.
Instead, create a row in a table of answers for each quiz with a field for
each answer (200 for the big list). You could then construct the sql
statement from the tester's answers in a WHERE clause and get your results
from one query.
hth,
tom
-----Original Message-----
From: John Eix [mailto:jeix@s...]
Sent: Wednesday, July 31, 2002 9:12 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Recordset Sizes
Here is the code for the function
==============Code====================
Function GetAnswerFromAnswerString(iQuestionNumber, strAnswers)
Dim strTemp
Dim iOffset
' I use InStrRev since I want to retrieve the last entered value
' in case they went back and changed their mind.
' Find the location of the question number we want to use
iOffset = InStrRev(strAnswers, "|" & iQuestionNumber & "|", -1,
1)
' Get our answer by using the offset we just found and then
moving
' right the length of the question indicator to arrive at the
' appropriate letter
strTemp = Mid(strAnswers, iOffset + Len("|" & iQuestionNumber &
"|"), 1)
' There's no way it should be anything else, but to be sure we
' convert it to a string and make sure it's uppercase
GetAnswerFromAnswerString = UCase(CStr(strTemp))
End Function
===============End of Code======================
Thanks!
-----Original Message-----
From: TomMallard [mailto:mallard@s...]
Sent: July 31, 2002 11:31
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Recordset Sizes
Can you post the code for GetAnswerFromAnswerString(I, strAnswers)?
tom mallard
seattle
-----Original Message-----
From: John Eix [mailto:jeix@s...]
Sent: Tuesday, July 30, 2002 7:46 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Recordset Sizes
Hi
My problem is this, I use a script to select recordsets of between 4 and
200 records from an Access database, the script that uses the resulting
recordset works fine for the recordsets of 4 to 25 records but the same
script does not work for record set of 200 records. Here is the script I
am using for the selection and comparison
=================Script=========================
' create the SQL string
strSQL ="SELECT * " & "FROM IB "
strSQL = strSQL & "WHERE unit = '" & Session("QuizName")
& "'"
strSQL = strSQL & " ORDER BY ItemNum"
' create the recordset object
Set rsQuiz = Server.CreateObject ("ADODB.Recordset")
' now open it
rsQuiz.open strSQL, strconnect, adOpenStatic,
adLockReadOnly, adCmdText
rsQuiz.MoveFirst
'now compare the right answers in the recordset with
those stored in strAnswers
iScore = 0
I = 1
Do While I =< iNumberOfQuestions
If UCase(CStr(rsQuiz.Fields("Answer").Value))
GetAnswerFromAnswerString(I, strAnswers) Then
Response.write
UCase(CStr(rsQuiz.Fields("Answer").Value))
Response.write
GetAnswerFromAnswerString(I, strAnswers)
Response.write iScore
iScore = iScore + 1
Else
strResults = strResults & I & ",
"
End If
I = I + 1
rsQuiz.MoveNext
Loop
' Close and dispose of our DB objects
rsQuiz.Close
Set rsQuiz = Nothing
=====================Script Ends========================
As I said this script works fine for small recordsets but the debugging
statements "Response.write UCase(CStr(rsQuiz.Fields("Answer").Value))
Response.write GetAnswerFromAnswerString(I, strAnswers)" show nothing
when the 200 record recordset is used???? I have checked and displayed
the rsQuiz recordset for small and large recordsets and have made sure
that all the variables have the appropriate values. I do not understand
why the comparison "If UCase(CStr(rsQuiz.Fields("Answer").Value))
GetAnswerFromAnswerString(I, strAnswers)" does not work for the large
recordset. I first thought that maybe the "Answers" for the large
recordset were somehow formatted differently but I don't see how that
could be possible the field in the database is text. Thank you for your
responses
.........................................
John Eix ]8-)
E-mail: jeix@s...
ECS web site: http://eix.dyndns.org/
The Twin's web site http://eix.dyndns.org/twins/
Holly's web site http://eix.dyndns.org/holly/
ChemEd Trading Post: http://eix.dyndns.org/tp/
Hamilton-Niagara Conference: http://eix.dyndns.org/hnc/
Mobile Phone: xxx-xxx-xxxx
Phone: xxx-xxx-xxxx
Eix Consulting Services
1345 Kensington Pk Rd
OAKVILLE, ON
L6H 2G8
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
Message #5 by "John Eix" <jeix@s...> on Wed, 31 Jul 2002 15:44:57 -0400
|
|
Thanks will give it a try! TTYS John
-----Original Message-----
From: TomMallard [mailto:mallard@s...]
Sent: July 31, 2002 14:49
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Recordset Sizes
Since this is server-side, I think the way to get around the performance
bottleneck is not to use string manipulations, that's what's killing it.
Instead, create a row in a table of answers for each quiz with a field
for each answer (200 for the big list). You could then construct the sql
statement from the tester's answers in a WHERE clause and get your
results from one query.
hth,
tom
-----Original Message-----
From: John Eix [mailto:jeix@s...]
Sent: Wednesday, July 31, 2002 9:12 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Recordset Sizes
Here is the code for the function
==============Code====================
Function GetAnswerFromAnswerString(iQuestionNumber, strAnswers) Dim
strTemp Dim iOffset
' I use InStrRev since I want to retrieve the last entered value
' in case they went back and changed their mind.
' Find the location of the question number we want to use
iOffset = InStrRev(strAnswers, "|" & iQuestionNumber & "|", -1,
1)
' Get our answer by using the offset we just found and then
moving
' right the length of the question indicator to arrive at the
' appropriate letter
strTemp = Mid(strAnswers, iOffset + Len("|" & iQuestionNumber &
"|"), 1)
' There's no way it should be anything else, but to be sure we
' convert it to a string and make sure it's uppercase
GetAnswerFromAnswerString = UCase(CStr(strTemp)) End Function
===============End of Code======================
Thanks!
-----Original Message-----
From: TomMallard [mailto:mallard@s...]
Sent: July 31, 2002 11:31
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Recordset Sizes
Can you post the code for GetAnswerFromAnswerString(I, strAnswers)?
tom mallard
seattle
-----Original Message-----
From: John Eix [mailto:jeix@s...]
Sent: Tuesday, July 30, 2002 7:46 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Recordset Sizes
Hi
My problem is this, I use a script to select recordsets of between 4 and
200 records from an Access database, the script that uses the resulting
recordset works fine for the recordsets of 4 to 25 records but the same
script does not work for record set of 200 records. Here is the script I
am using for the selection and comparison
=================Script=========================
' create the SQL string
strSQL ="SELECT * " & "FROM IB "
strSQL = strSQL & "WHERE unit = '" & Session("QuizName")
& "'"
strSQL = strSQL & " ORDER BY ItemNum"
' create the recordset object
Set rsQuiz = Server.CreateObject ("ADODB.Recordset")
' now open it
rsQuiz.open strSQL, strconnect, adOpenStatic,
adLockReadOnly, adCmdText
rsQuiz.MoveFirst
'now compare the right answers in the recordset with
those stored in strAnswers
iScore = 0
I = 1
Do While I =< iNumberOfQuestions
If UCase(CStr(rsQuiz.Fields("Answer").Value))
GetAnswerFromAnswerString(I, strAnswers) Then
Response.write
UCase(CStr(rsQuiz.Fields("Answer").Value))
Response.write
GetAnswerFromAnswerString(I, strAnswers)
Response.write iScore
iScore = iScore + 1
Else
strResults = strResults & I & ",
"
End If
I = I + 1
rsQuiz.MoveNext
Loop
' Close and dispose of our DB objects
rsQuiz.Close
Set rsQuiz = Nothing
=====================Script Ends========================
As I said this script works fine for small recordsets but the debugging
statements "Response.write UCase(CStr(rsQuiz.Fields("Answer").Value))
Response.write GetAnswerFromAnswerString(I, strAnswers)" show nothing
when the 200 record recordset is used???? I have checked and displayed
the rsQuiz recordset for small and large recordsets and have made sure
that all the variables have the appropriate values. I do not understand
why the comparison "If UCase(CStr(rsQuiz.Fields("Answer").Value))
GetAnswerFromAnswerString(I, strAnswers)" does not work for the large
recordset. I first thought that maybe the "Answers" for the large
recordset were somehow formatted differently but I don't see how that
could be possible the field in the database is text. Thank you for your
responses
.........................................
John Eix ]8-)
E-mail: jeix@s...
ECS web site: http://eix.dyndns.org/
The Twin's web site http://eix.dyndns.org/twins/
Holly's web site http://eix.dyndns.org/holly/
ChemEd Trading Post: http://eix.dyndns.org/tp/
Hamilton-Niagara Conference: http://eix.dyndns.org/hnc/
Mobile Phone: xxx-xxx-xxxx
Phone: xxx-xxx-xxxx
Eix Consulting Services
1345 Kensington Pk Rd
OAKVILLE, ON
L6H 2G8
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
|
|
 |