Microsoft VBScript runtime error '800a01f9' - Invalid or unqualified reference

Help!!

I'm getting the following error --

Microsoft VBScript runtime error '800a01f9'

Invalid or unqualified reference

/prts/resulttable.asp, line 71

Here is my code ...

<% 
If NOT IsArray(arrResults) Then
With response

.write("<div style=""background-color:#f2dede; padding:10px; border: 1px solid; border-color: #eed3d7; font-size:12px; margin-top: 12px;""><span class=""erroralert"" style=""font-weight:bold; color:#900; font-size: 1.2em;"">Error !</span> Error Error Error</div>" & VbCrLf)
End With
End If

If IsArray(arrResults) Then
With response

.write("<div id=""PriceGuideResults"">" & VbCrLf)
.write("<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"" style=""border-collapse:collapse;"">" & VbCrLf)
.write("<tr>" & VbCrLf)
.write("<th scope=""col"" style=""line-height:34px; font-size:13px; text-align: left; padding: 0px 8px; border-radius:3px 0px 0px 0px; background-color:#999999; color: #FFF; border-bottom: 1px solid; border-bottom-color: #666; width: 100px; text-shadow: 3px 0px 2px rgba(150, 150, 150, 1);"">Brand</th>" & VbCrLf)
.write("<th scope=""col"" style=""line-height:34px; font-size:13px; text-align: left; padding: 0px 8px; background-color:#999999; color: #FFF; border-bottom: 1px solid; border-bottom-color: #666; width: 80px; text-shadow: 3px 0px 2px rgba(150, 150, 150, 1);"">SKU</th>" & VbCrLf)
.write("<th scope=""col"" style=""line-height:34px; font-size:13px; text-align: left; padding: 0px 8px; background-color:#999999; color: #FFF; border-bottom: 1px solid; border-bottom-color: #666; text-shadow: 3px 0px 2px rgba(150, 150, 150, 1);"">Product Name</th>" & VbCrLf)
.write("<th scope=""col"" style=""line-height:34px; font-size:13px; text-align: left; padding: 0px 8px; background-color:#999999; color: #FFF; border-bottom: 1px solid; border-bottom-color: #666; text-shadow: 3px 0px 2px rgba(150, 150, 150, 1); width: 200px;"">Category</th>" & VbCrLf)
.write("<th scope=""col"" style=""line-height:34px; font-size:13px; text-align: left; padding: 0px 8px; background-color:#999999; color: #FFF; border-bottom: 1px solid; border-bottom-color: #666; width: 74px; text-shadow: 3px 0px 2px rgba(150, 150, 150, 1);"">Trade Price</th>" & VbCrLf)
.write("<th scope=""col"" style=""line-height:34px; font-size:13px; text-align: left; padding: 0px 8px; background-color:#999999; color: #FFF; border-bottom: 1px solid; border-bottom-color: #666; width: 70px; text-shadow: 3px 0px 2px rgba(150, 150, 150, 1);"">TGI Price</th>" & VbCrLf)
.write("<th scope=""col"" style=""line-height:34px; font-size:13px; text-align: left; padding: 0px 8px; border-radius:0px 3px 0px 0px; background-color:#999999; color: #FFF; border-bottom: 1px solid; border-bottom-color: #666; width: 70px; text-shadow: 3px 0px 2px rgba(150, 150, 150, 1);"">SSP</th>" & VbCrLf)
.write("</tr>" & VbCrLf)

End With

Dim i
For i = 0 To UBound(arrResults, 2)

With response

.write("<tr>" & VbCrLf)
.write("<td>" & VbCrLf)
.write("<a href=""template-results.asp?brand=" & (arrResults(1,i)) & """ title=""See more "& Server.HTMLEncode(arrResults(2,i)) &" listings"">"& Server.HTMLEncode(arrResults(2,i)) &"</a>" & VbCrLf)
.write("</td>" & VbCrLf)
.write("<td>" & VbCrLf)
.write("<a class=""fancybox fancybox.iframe"" href=""detail.asp?id="& (arrResults(0,i)) &""" title=""View product detail"">"& Server.HTMLEncode(arrResults(3,i)) &"</a>" & VbCrLf)
.write("</td>" & VbCrLf)
.write("<td>" & VbCrLf)
.write("<a class=""fancybox fancybox.iframe"" href=""detail.asp?id="& (arrResults(0,i)) &""" title=""View product detail"">"& Server.HTMLEncode(arrResults(8,i)) &"</a>" & VbCrLf)
.write("</td>" & VbCrLf)
.write("<td>" & VbCrLf)

if (arrResults(4,i)) <> """" then
.write(""& Server.HTMLEncode(arrResults(4,i)) &"" & VbCrLf)
End If
if (arrResults(5,i)) <> """" then
.write("/"& Server.HTMLEncode(arrResults(5,i)) &"" & VbCrLf)
End if
if (arrResults(6,i)) <> """" then
.write("/"& Server.HTMLEncode(arrResults(6,i)) &"" & VbCrLf)
End if
if (arrResults(7,i)) <> """" then
.write("/"& Server.HTMLEncode(arrResults(7,i)) &"" & VbCrLf)
End if

.write("</td>" & VbCrLf)
.write("<td>" & VbCrLf)
.write(""& Server.HTMLEncode(arrResults(9,i)) &"" & VbCrLf)
.write("</td>" & VbCrLf)
.write("<td>" & VbCrLf)
.write(""& Server.HTMLEncode(arrResults(10,i)) &"" & VbCrLf)
.write("</td>" & VbCrLf)
.write("<td>" & VbCrLf)
.write(""& Server.HTMLEncode(arrResults(11,i)) &"" & VbCrLf)
.write("</td>" & VbCrLf)
.write("</tr>" & VbCrLf)

End With 
next

.write("</table>" & VbCrLf)
.write("</div>" & VbCrLf)

End If
%>

Open in new window


Line 71 is --

.write("</table>" & VbCrLf)


Confused !

Thanks
garethtnashAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

garethtnashAuthor Commented:
I think the problem is with this --

if (arrResults(4,i)) <> """" then
.write(""& Server.HTMLEncode(arrResults(4,i)) &"" & VbCrLf)
End If
if (arrResults(5,i)) <> """" then
.write("/"& Server.HTMLEncode(arrResults(5,i)) &"" & VbCrLf)
End if
if (arrResults(6,i)) <> """" then
.write("/"& Server.HTMLEncode(arrResults(6,i)) &"" & VbCrLf)
End if
if (arrResults(7,i)) <> """" then
.write("/"& Server.HTMLEncode(arrResults(7,i)) &"" & VbCrLf)
End if

Open in new window


How else do I only show something if it exists.....?
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I think you need to change your last 2 lines to

response.write("</table>" & VbCrLf)
response.write("</div>" & VbCrLf)
0
pateljituCommented:
Line 71 and 72 are outside of the WITH block, hence the error.

Please replace code on line 71 - 21:
.write("</table>" & VbCrLf)
.write("</div>" & VbCrLf)

with

Response.write("</table>" & VbCrLf)
Response.write("</div>" & VbCrLf)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
garethtnashAuthor Commented:
Well spotted guys thank you :)
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Sometimes you just need another couple sets of eyeballs
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.