homepage Welcome to WebmasterWorld Guest from 54.226.173.169
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Request object error 'ASP 0105 : 80004005'
theebalinda




msg:957563
 6:47 pm on Dec 6, 2002 (gmt 0)

Request object error 'ASP 0105 : 80004005'

Index out of range

/ml49/si/12-4/searchclass.asp, line 44

An array index is out of range.

the part of the code that gives this error is :
'Check to see if form has been submitted
If Request.QueryString("submit") = "submit" OR _
Request.QueryString("search")<> "" OR _
(Request.QueryString("search")= "" AND Request.QueryString.key(1) = "search") Then
'Check for Errors
Dim strErrors
strErrors = isValid()
If strErrors<> "" Then
Response.Write"<span class='error'>" & strErrors & "</span>"
Else
'Get Results
Dim objRecordset
Set objRecordset = getMatches()

'Output Results

The Request.QueryString.key(1)="search" is the reason why I believe we get the message. Cos when the page loads first (before the page is submitted) there doesn's exist key-value(key/item) pair to correspond with the request.querystring.key(1).... what could be the possible solutions to this issue?

 

aspdaddy




msg:957564
 7:21 pm on Dec 6, 2002 (gmt 0)

Is this a form? If method method=post thee is no querystring colection

You can avoid problems by just using (in ASP) :
Request(varName)

korkus2000




msg:957565
 7:24 pm on Dec 6, 2002 (gmt 0)

Why are you using Request.Querystring.key? Will the name be different?

theebalinda




msg:957566
 8:02 pm on Dec 6, 2002 (gmt 0)

this is a form with a Method='get'

theebalinda




msg:957567
 8:05 pm on Dec 6, 2002 (gmt 0)

I found the solution...

The reason was Request.QueryString.Key(1) was checking for the key-value pairs and when the page first loaded there werent any key-value pairs. so I used an if-then statement to see if the text field of the form was filled... if it wasnt then it would do nothing otherwise it would check for the key-value string... thanks for the replies...

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved