Solved

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

Posted on 2004-04-05
20
692 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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