Solved

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

Posted on 2004-04-05
20
690 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
ID: 10756608
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
ID: 10756612
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
ID: 10756643
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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 10756661
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
ID: 10756806
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
ID: 10757000
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
ID: 10757026
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
ID: 10757064
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
ID: 10757073
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
ID: 10757086
TheKenman: please review previous posts, your above code is exactly identical to my code.


-Brian
0
 
LVL 11

Expert Comment

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

Expert Comment

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


-Brian
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 10757113
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
ID: 10757139
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
ID: 10757158
I was refering to your first post, I posted before i saw your second post.


0
 
LVL 7

Expert Comment

by:TheKenman
ID: 10757196
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
ID: 10757239
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
ID: 10757250
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
ID: 10757280
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
ID: 10760455
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 Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
If-Then-Else ASP problem 6 67
Select only the top record in a left join 13 45
ASP server side get value 15 35
Writing comments on <p></P> or paragraph 2 19
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

791 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