Solved

error '80020009'  - No reason for it that I can find.

Posted on 2004-04-05
20
686 Views
Last Modified: 2011-09-20
I am getting the following error

error '80020009'
Exception occurred.
/apps/prototypect/shipper_view.asp, line 319


And nothing I have found here on EE or on google has helped. I'm getting frustrated. Can someone point out what I'm apparently missing here?

Code is below, line 319 preceded with 5 *'s (*****)


<%
Dim varShip, varFileName
varShip = qShipper("ShipVia")
If varShip = "Hand Deliver" Then
*****   If qHD("FName") <> "" Then
     varFileName = replace(qHD("FName"), " ", "%20")
     response.Write("<a href=UploadsSHP/"&varFileName&" target=_blank>Hand Deliver</a>")
   Else
     response.Write("Hand Deliver")
   End If
Else
   response.Write(qShipper("ShipVia"))
End If
%>
0
Comment
Question by:Mustangz
  • 8
  • 6
  • 4
  • +1
20 Comments
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
Try this:



<%
Dim varShip, varFileName
varShip = qShipper("ShipVia")
If varShip = "Hand Deliver" Then
  If Not qHD("FName") = "" Then
     varFileName = replace(qHD("FName"), " ", "%20")
     response.Write("<a href=UploadsSHP/"&varFileName&" target=_blank>Hand Deliver</a>")
   Else
     response.Write("Hand Deliver")
   End If
Else
   response.Write(qShipper("ShipVia"))
End If
%>


good luck
-brian
0
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
or even possibly:


<%
Dim varShip, varFileName
varShip = qShipper("ShipVia")
If varShip = "Hand Deliver" Then
  If len(qHD("FName")) > 0 Then
     varFileName = replace(qHD("FName"), " ", "%20")
     response.Write("<a href=UploadsSHP/"&varFileName&" target=_blank>Hand Deliver</a>")
   Else
     response.Write("Hand Deliver")
   End If
Else
   response.Write(qShipper("ShipVia"))
End If
%>

-brian
0
 
LVL 11

Expert Comment

by:Sven
Comment Utility
What is qHD("FName") ? It seems to be a recordset. Please provide the code above these lines also, especially the lines where qHD("FName") or the qHD object is referenced to!
0
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
The function shouldnt matter should it? Because if the function its self was causing the problem it would error on the function. Or the function would be returning Null as the string, either way, its erroring on the If line.


-Brian
0
 
LVL 7

Expert Comment

by:TheKenman
Comment Utility
Hi Mustangz,

I would try:
   
    If Not qHD("FName") = "" Then

Could also try:

    If isNull(qHD("FName")) Then

..or:

    If isEmpty(qHD("FName")) Then
0
 

Author Comment

by:Mustangz
Comment Utility
Brian:
None of those seemed to work, kept getting the same error.

TheKenman:
Your last two caused my page to load without error, but gave me backwards results, as I want to know if qHD("FName") is NOT NULL. So I reversed some of my code as shown below, and then get the same error but now several lines below (marked with 5 *'s)

<%
Dim varShip, varFileName
varShip = qShipper("ShipVia")
If varShip = "Hand Deliver" Then
   If isEmpty(qHD("FName")) Then
   response.Write("Hand Deliver")
   Else
*****   varFileName = replace(qHD("FName"), " ", "%20")
   response.Write("<a href=UploadsSHP/"&varFileName&" target=_blank>Hand Deliver</a>")
   End If
Else
   response.Write(qShipper("ShipVia"))
End If
%>


DarthSonic:
Below is my SELECT where I am getting qHD("FName") from. Am I doing anything strange here? Yes, I'm using dreamweaver, as I'm a bit of a noob with ASP. The FName field is a varCHAR 50, and SHID is an int 4 on a Microsoft SQL 2000 database.

Set qHD = Server.CreateObject("ADODB.Recordset")
qHD.ActiveConnection = MM_connPrototype_STRING
qHD.Source = "SELECT SHID, FName FROM dbo.tblHandDeliver WHERE SHID = " & Replace(qHD__MMColParam, "'", "''") & ""
qHD.CursorType = 0
qHD.CursorLocation = 2
qHD.LockType = 1
qHD.Open()
0
 
LVL 7

Expert Comment

by:TheKenman
Comment Utility
Try:

<%
Dim varShip, varFileName
varShip = qShipper("ShipVia")
If varShip = "Hand Deliver" Then
  If Not isEmpty(qHD("FName")) Then
     varFileName = replace(qHD("FName"), " ", "%20")
     response.Write("<a href=UploadsSHP/"&varFileName&" target=_blank>Hand Deliver</a>")
   Else
     response.Write("Hand Deliver")
   End If
Else
   response.Write(qShipper("ShipVia"))
End If
%>
0
 
LVL 11

Accepted Solution

by:
Sven earned 200 total points
Comment Utility
Try the following SQL statement:

"SELECT SHID, isNull(FName,'') FROM dbo.tblHandDeliver WHERE SHID = " & Replace(qHD__MMColParam, "'", "''") & ""

With the isNull sql-function you will get no null values in recordset but empty strings "" and your origin if statement should work!

Also you should check if recordset is empty before accessing any value:

if not (qHD.BOF and qHD.EOF) then
  'do the work
else
  'recordset is empty
end if
0
 
LVL 7

Expert Comment

by:TheKenman
Comment Utility
This should do the same for you though:

<%
Dim varShip, varFileName
varShip = qShipper("ShipVia")
varName = qHD("FName")
If varShip = "Hand Deliver" Then
   If Not varName = "" Then
     varFileName = Server.URLEncode(varName)
     'uncomment next line if the above fails
     'varFileName = Server.URLPathEncode(varName)
     response.Write("<a href=""UploadsSHP/"&varFileName&""" target=""_blank"">Hand Deliver</a>")
   Else
     response.Write("Hand Deliver")
   End If
Else
   response.Write(qShipper("ShipVia"))
End If
%>
0
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
TheKenman: please review previous posts, your above code is exactly identical to my code.


-Brian
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 11

Expert Comment

by:Sven
Comment Utility
@TheKenman: If qHD is not a recordset or empty he will get an error!
0
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
The only thing you changed was you moved it to a complete useless variable called "varName".


-Brian
0
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
Try this, I think it will work.

<%
Dim varShip, varFileName
varShip = qShipper("ShipVia")
If varShip = "Hand Deliver" Then
  If isEmpty(qHD("FName")) Then
   response.Write("Hand Deliver")
  Else
  varFileName = replace(cstr(qHD("FName")), " ", "%20")
  response.Write("<a href=UploadsSHP/"&varFileName&" target=_blank>Hand Deliver</a>")
  End If
Else
  response.Write(qShipper("ShipVia"))
End If
%>


-Brian
0
 
LVL 7

Expert Comment

by:TheKenman
Comment Utility
Brian,

I believe you need to go back to grammar school and learn how to read. My code is in no way "exactly identical" (redundant?) to yours!!!

Please read the comments fully before getting so critical.
0
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
I was refering to your first post, I posted before i saw your second post.


0
 
LVL 7

Expert Comment

by:TheKenman
Comment Utility
Now you're just making stuff up.

My first post didn't use varName. My second post didn't use varName. My THIRD post used varName and Server.URLEncode, and was completely different from any of yours.

Thanks for your concern though.
0
 
LVL 11

Expert Comment

by:Sven
Comment Utility
Boys! Please! We want to help Mustangz. Your personal conflict is not part of this discussion!

@Mustangz: Have you allready tried my solution? However we should not avoid the error by error handling the variable, but we should look for the source of the problem. I think it's an empty recordset or a null field!
0
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
Why dont you try:

varFileName = CStr(qHD("FName"))  'conver to string
if varFileName <> "" then
 'not empty
else
 'empty
end if
0
 

Author Comment

by:Mustangz
Comment Utility
I appreciate everyone's input and suggestions. I went down the line trying all suggestions in the order in which they were provided, and DarthSonic is the one that fixed me.

Thanks again to everyone, I do appreciate the quick responses.
0
 
LVL 7

Expert Comment

by:TheKenman
Comment Utility
Yes, sorry, but I felt Brian was trying to discredit my posts, and so I feel I must stick up for my responses. I did not start it.

Glad you got it working Mustangz!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now