473,239 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,239 software developers and data experts.

Request object error 'ASP 0105 : 80004005' ( Index out of range )

hI,
wOULD PLEASE HELP ME. I AM GETTIGN THE REQUEST OBJECT ERROS ASP 0105:
80004005 INDEX OUT OF RANGE ERROR. HERE IS THE SNIPPET OF CODE THAT I
AM USING. WHAT IS WRONG HERE? YOU CAN SEE WHAT I AM TRYING TO DO ADN
ERROR ON THIS LINK: http://www.walani.com/ProjectFiles/01_main.asp.

PLEASE HELP

<%
Dim iQuestions 'Holds the question
Dim nScore ' Holds the number of answer

'Set nScore to highest possible score
nScore = 3

iQuestions = 1
While Not objRS.EOF

'==================THIS IS WHERE THE ERROR IS
If Request.Form(objRS("QID")) = objRS("QCorrectAnswer") Then
bRightWrong = 1
Else
bRightWrong = 0
'~~~~~Set minus by number For how much Is counted off For Each
question~~~~~~
nScore = nScore - 1

End If
'~~~~Save the answers and grade to each question~~~~~~
strSQL = "INSERT INTO tblStudentTests
(STUserID,STQID,STAnswer,STRightWrong) VALUES ('" &
Request.Cookies("LoginData")("Login") & "@" &
Request.Cookies("LoginData")("Pass") & "', " & objRS("QID") & ",'" &
Request.Form(objRS("QID")) & "','" & bRightWrong & "')"
objConn.Execute(strSQL)

'~~~~~Show Question with Student answer and Grade~~~~~~
Response.Write(iQuestions & ". " & objRS("QQuestion") & ":<BR>")
Response.Write("Your Answer: " & Request.Form(objRS("QID")) & "<BR>")
Response.Write("<B>" & bRightWrong & "</B><BR><BR>")
objRS.MoveNext
iQuestions = iQuestions + 1
wend
%>
ANDY
Jul 19 '05 #1
6 6827
When I saw the all-caps, I almost deleted the message without reading it.
Please do not shout in the future. It makes your message hard to read. See
below for my response:

Andy wrote:
While Not objRS.EOF

'==================THIS IS WHERE THE ERROR IS


To be able to help you, we need to know what is contained in objRS("QID")
and the names and values of your form variables in Request. So do this:

Response.Write "QID contains :" & objRS("QID") & "<BR>"
Response.Write "The Form collection contains:<BR>"
for each key in Request.Form
Response.Write key & ": " & Request.Form(key) & "<BR"
next
response.end

If running this fails to show you what's wrong, post the results back here
so we can look at it.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #2
Thanks bob. I have done what you suggested and here are the results from
your suggested code

QID contains :1
The Form collection contains:
1: Junkyard Wars<BR2: In my car<BR31: programming Language<BR

It looks like in the collection it is reading the second line before the
first one. I have checked in my database and th tables are linked
accordingly. One table has a list of questions with the correct answer.
Another table has a list of possible answers and i have linked this
using the question ID
Thanks once again.
What is wrong?

Bob Barrows wrote:
When I saw the all-caps, I almost deleted the message without reading it.
Please do not shout in the future. It makes your message hard to read. See
below for my response:

Andy wrote:

While Not objRS.EOF

'==================THIS IS WHERE THE ERROR IS

To be able to help you, we need to know what is contained in objRS("QID")
and the names and values of your form variables in Request. So do this:

Response.Write "QID contains :" & objRS("QID") & "<BR>"
Response.Write "The Form collection contains:<BR>"
for each key in Request.Form
Response.Write key & ": " & Request.Form(key) & "<BR"
next
response.end

If running this fails to show you what's wrong, post the results back here
so we can look at it.

Bob Barrows


Jul 19 '05 #3
Thanks Bob here are the results of what you suggested. It seems to work
as it picks up the correct object
QID contains :2
The Form collection contains:
1: Active Server Pages
2: In my car
31: Donít know

So what can be wrong then?
Thanks in advance for your help.

Andy
Bob Barrows wrote:
When I saw the all-caps, I almost deleted the message without reading it.
Please do not shout in the future. It makes your message hard to read. See
below for my response:

Andy wrote:

While Not objRS.EOF

'==================THIS IS WHERE THE ERROR IS



To be able to help you, we need to know what is contained in objRS("QID")
and the names and values of your form variables in Request. So do this:

Response.Write "QID contains :" & objRS("QID") & "<BR>"
Response.Write "The Form collection contains:<BR>"
for each key in Request.Form
Response.Write key & ": " & Request.Form(key) & "<BR"
next
response.end

If running this fails to show you what's wrong, post the results back here
so we can look at it.

Bob Barrows


Jul 19 '05 #4
Andy K wrote:
Thanks Bob here are the results of what you suggested. It seems to
work
as it picks up the correct object
QID contains :2
The Form collection contains:
1: Active Server Pages
2: In my car
31: Donít know

So what can be wrong then?
Thanks in advance for your help.

Andy
Bob Barrows wrote:
When I saw the all-caps, I almost deleted the message without
reading it. Please do not shout in the future. It makes your message
hard to read. See below for my response:

Andy wrote:

While Not objRS.EOF

'==================THIS IS WHERE THE ERROR IS

To be able to help you, we need to know what is contained in
objRS("QID") and the names and values of your form variables in
Request. So do this:

Response.Write "QID contains :" & objRS("QID") & "<BR>"
Response.Write "The Form collection contains:<BR>"
for each key in Request.Form
Response.Write key & ": " & Request.Form(key) & "<BR"
next
response.end

If running this fails to show you what's wrong, post the results
back here so we can look at it.

Bob Barrows


I suspect that in this line:

If Request.Form(objRS("QID")) = objRS("QCorrectAnswer") Then

the content of objRS("QID") is being interpreted as a number (why are you
using numbers for your form field names?) instead of a string, so instead of
looking for a form variable named "31", it's looking for the 31st item in
the form variables collection, which just isn't there.

As an initial try at working around this, you might try this:

If Request.Form(CStr(objRS("QID"))) = objRS("QCorrectAnswer") Then

If that does not work, then I suggest adding an alpha character to your form
field names, so that instead of being named 1,2,31, they are named f1, f2.
f31. This will allow you to do this:

If Request.Form("f" & objRS("QID")) = objRS("QCorrectAnswer") Then
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #5
Bob,
I triedn converting the whole thing to a string as you suggested adn
that doesn't work as well.
Infact in my form name field is the same as the QID, which is an
AutoNumber in the access database. This is how I have assigned it.
Response.Write("<INPUT TYPE='radio' NAME='" & objRS("QID") & " VALUE='"
& objRS2("AAnswer") & "'>" & objRS2("AAnswer") & "<BR>")

This is on a different form.

Any Ideas, Thanks Bob

Bob Barrows wrote:
Andy K wrote:
Thanks Bob here are the results of what you suggested. It seems to
work
as it picks up the correct object
QID contains :2
The Form collection contains:
1: Active Server Pages
2: In my car
31: Donít know

So what can be wrong then?
Thanks in advance for your help.

Andy
Bob Barrows wrote:

When I saw the all-caps, I almost deleted the message without
reading it. Please do not shout in the future. It makes your message
hard to read. See below for my response:

Andy wrote:

While Not objRS.EOF

'==================THIS IS WHERE THE ERROR IS
To be able to help you, we need to know what is contained in
objRS("QID") and the names and values of your form variables in
Request. So do this:

Response.Write "QID contains :" & objRS("QID") & "<BR>"
Response.Write "The Form collection contains:<BR>"
for each key in Request.Form
Response.Write key & ": " & Request.Form(key) & "<BR"
next
response.end

If running this fails to show you what's wrong, post the results
back here so we can look at it.

Bob Barrows



I suspect that in this line:

If Request.Form(objRS("QID")) = objRS("QCorrectAnswer") Then

the content of objRS("QID") is being interpreted as a number (why are you
using numbers for your form field names?) instead of a string, so instead of
looking for a form variable named "31", it's looking for the 31st item in
the form variables collection, which just isn't there.

As an initial try at working around this, you might try this:

If Request.Form(CStr(objRS("QID"))) = objRS("QCorrectAnswer") Then

If that does not work, then I suggest adding an alpha character to yourform
field names, so that instead of being named 1,2,31, they are named f1, f2.
f31. This will allow you to do this:

If Request.Form("f" & objRS("QID")) = objRS("QCorrectAnswer") Then


HTH,
Bob Barrows


Jul 19 '05 #6
Thanks Bob,
It worked as you suggested. I had to conver everythign to string.

great, many thanks

Andy K wrote:
Bob,
I triedn converting the whole thing to a string as you suggested adn
that doesn't work as well.
Infact in my form name field is the same as the QID, which is an
AutoNumber in the access database. This is how I have assigned it.
Response.Write("<INPUT TYPE='radio' NAME='" & objRS("QID") & " VALUE='"
& objRS2("AAnswer") & "'>" & objRS2("AAnswer") & "<BR>")

This is on a different form.

Any Ideas, Thanks Bob

Bob Barrows wrote:
Andy K wrote:
Thanks Bob here are the results of what you suggested. It seems to
work
as it picks up the correct object
QID contains :2
The Form collection contains:
1: Active Server Pages
2: In my car
31: Donít know

So what can be wrong then?
Thanks in advance for your help.

Andy
Bob Barrows wrote:
When I saw the all-caps, I almost deleted the message without
reading it. Please do not shout in the future. It makes your message
hard to read. See below for my response:

Andy wrote:

> While Not objRS.EOF
>
> '==================THIS IS WHERE THE ERROR IS

To be able to help you, we need to know what is contained in
objRS("QID") and the names and values of your form variables in
Request. So do this:

Response.Write "QID contains :" & objRS("QID") & "<BR>"
Response.Write "The Form collection contains:<BR>"
for each key in Request.Form
Response.Write key & ": " & Request.Form(key) & "<BR"
next
response.end

If running this fails to show you what's wrong, post the results
back here so we can look at it.

Bob Barrows


I suspect that in this line:

If Request.Form(objRS("QID")) = objRS("QCorrectAnswer") Then

the content of objRS("QID") is being interpreted as a number (why are you
using numbers for your form field names?) instead of a string, so
instead of
looking for a form variable named "31", it's looking for the 31st itemin
the form variables collection, which just isn't there.

As an initial try at working around this, you might try this:

If Request.Form(CStr(objRS("QID"))) = objRS("QCorrectAnswer") Then

If that does not work, then I suggest adding an alpha character to
your form
field names, so that instead of being named 1,2,31, they are named f1,
f2.
f31. This will allow you to do this:

If Request.Form("f" & objRS("QID")) = objRS("QCorrectAnswer") Then
HTH,
Bob Barrows




Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John Beschler | last post by:
There is a limit to the amount of data you can post through a form. For a file of that size you probably need to treat it as an upload. >-----Original Message----- >I've got a an ASP page...
6
by: Christopher Brandsdal | last post by:
Hi! I get an error when I run my code Is there any other way to get te information from my form? Heres the error I get and the code beneath. Line 120 is market with ''''''''''''Line...
12
by: Grahammer | last post by:
For some reason I am getting an error when trying to open a recordset on an Access database on my Win2K3 machine from my INDEX.ASP page, but the same code accesses the database fine when coming...
10
by: thomas parquier | last post by:
Hello Can someone give the snippet to send a post http request in order to send a soap request ? I have the complete http request but I don't know how to send it. TIA
1
by: P Cooper | last post by:
(Posted in multiple groups...Apologies) Why does the error below occur whenever the statement Request.BinaryRead(Request.TotalBytes) is executed for uploads larger than 100K? I thought the 100K...
2
by: F. Nolet | last post by:
Hi, With IIS 6 - ASP : I try to upload a file of 125,000,000 bytes. To do it, I use this code : Request.BinaryRead(Request.TotalBytes) I get this error :
6
by: Daniel Rimmelzwaan | last post by:
I want to send a biztalk document to an aspx page, and I need to see some sample code, because I just can't make it work. I have a port with transport type HTTP, pointing to my aspx page, something...
4
by: steve_jackson | last post by:
I get this error, when I am trying to update a table in an Access DB through our intranet. Here is the section of code that is generating the error: FormItemID = Request.Form("FID") StoreNo =...
1
by: rahulkhunteta | last post by:
Request object error ĎASP 0105 : 80004005í Index out of range /printcdsc/printsubscriptionsmainpage.asp,line55 An array index is out of range. I am getting this message while submitting a...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youíll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.