Mustangz
asked on
error '80020009' - No reason for it that I can find.
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/"&varFileN ame&" target=_blank>Hand Deliver</a>")
Else
response.Write("Hand Deliver")
End If
Else
response.Write(qShipper("S hipVia"))
End If
%>
error '80020009'
Exception occurred.
/apps/prototypect/shipper_
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/"&varFileN
Else
response.Write("Hand Deliver")
End If
Else
response.Write(qShipper("S
End If
%>
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/"&varFileN ame&" target=_blank>Hand Deliver</a>")
Else
response.Write("Hand Deliver")
End If
Else
response.Write(qShipper("S hipVia"))
End If
%>
-brian
<%
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/"&varFileN
Else
response.Write("Hand Deliver")
End If
Else
response.Write(qShipper("S
End If
%>
-brian
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!
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
-Brian
Hi Mustangz,
I would try:
If Not qHD("FName") = "" Then
Could also try:
If isNull(qHD("FName")) Then
..or:
If isEmpty(qHD("FName")) Then
I would try:
If Not qHD("FName") = "" Then
Could also try:
If isNull(qHD("FName")) Then
..or:
If isEmpty(qHD("FName")) Then
ASKER
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/"&varFileN ame&" target=_blank>Hand Deliver</a>")
End If
Else
response.Write(qShipper("S hipVia"))
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()
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/"&varFileN
End If
Else
response.Write(qShipper("S
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
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()
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/"&varFileN ame&" target=_blank>Hand Deliver</a>")
Else
response.Write("Hand Deliver")
End If
Else
response.Write(qShipper("S hipVia"))
End If
%>
<%
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/"&varFileN
Else
response.Write("Hand Deliver")
End If
Else
response.Write(qShipper("S
End If
%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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(varNa me)
response.Write("<a href=""UploadsSHP/"&varFil eName&""" target=""_blank"">Hand Deliver</a>")
Else
response.Write("Hand Deliver")
End If
Else
response.Write(qShipper("S hipVia"))
End If
%>
<%
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(varNa
response.Write("<a href=""UploadsSHP/"&varFil
Else
response.Write("Hand Deliver")
End If
Else
response.Write(qShipper("S
End If
%>
TheKenman: please review previous posts, your above code is exactly identical to my code.
-Brian
-Brian
@TheKenman: If qHD is not a recordset or empty he will get an error!
The only thing you changed was you moved it to a complete useless variable called "varName".
-Brian
-Brian
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/"&varFileN ame&" target=_blank>Hand Deliver</a>")
End If
Else
response.Write(qShipper("S hipVia"))
End If
%>
-Brian
<%
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"))
response.Write("<a href=UploadsSHP/"&varFileN
End If
Else
response.Write(qShipper("S
End If
%>
-Brian
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.
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.
I was refering to your first post, I posted before i saw your second post.
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.
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.
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!
@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!
Why dont you try:
varFileName = CStr(qHD("FName")) 'conver to string
if varFileName <> "" then
'not empty
else
'empty
end if
varFileName = CStr(qHD("FName")) 'conver to string
if varFileName <> "" then
'not empty
else
'empty
end if
ASKER
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.
Thanks again to everyone, I do appreciate the quick responses.
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!
Glad you got it working Mustangz!
<%
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/"&varFileN
Else
response.Write("Hand Deliver")
End If
Else
response.Write(qShipper("S
End If
%>
good luck
-brian