Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP 0101~Unexpected error~The function returned |.

Status
Not open for further replies.

BrianB

Programmer
Oct 2, 2000
186
US
A client has an asp 3 application that pulls data from an MS Access db.

The recordset fields can be either numeric or null, but sometimes when we try to access a field (even when it contains valid data), we get the 101 error. Sometimes the same recordset works fine.

Any suggestions? I'm baffled.

Brian Begy
BugSentry - Automatic error reporting
 
Without seeing any of your code, it's hard to even begin to offer any ideas. If you can post some of the relevant code, we can work from there.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
tempVal = 0

tempVal = rstEqpt("PL1")
if IsNull(tempVal) then
if request.QueryString("CloneFrom")>0 then
tempVal = rstEqpt("PL2")
logError(297) <<--[green]prints error to screen. No error detected.[/green]
end if
end if
if IsNull(tempVal) then
tempVal = 0
else
response.Write "not null" [green]<<--testing code. This gets printed, so it indicates that tempVal is not null[/green]
end if
response.Write tempVal [red]<--- blows up here.[/red]


In this instance PL1 is always null and PL2 is always 12. Both fields should return decimals.

Any suggestions?

caveat: this is the first time I have used asp 3 since 2001.


Brian Begy
BugSentry - Automatic error reporting
 
I don't see anything that immediately stands out, particularly if the error is happening on a response.write line. What is the exact error message being returned? Also, what is the code being used to produce your recordset?

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
SELECT (SELECT Top 1 Price FROM tblEquipment_Pricelists WHERE EquipmentID = EqptID And PriceListID = 0) AS PL1, (SELECT Top 1 Price FROM tblEquipment_Pricelists WHERE EquipmentID = EqptID And PriceListID = 1) AS PL2 , tblEquipment.EqptID, tblEquipment.EqptName FROM tblEquipment ORDER BY EqptName;

The recordset opens fine in Access, returning 1584 records with NULL, 12, [Name of equipment]

PL1 and PL2 are decimals (18,2) and EqptName is a text(250).

The exact error is: ASP 0101~Unexpected error~The function returned |.

which is, of course, totally useless.

I can't print rstEqpt("PL2") no matter what, which makes no sense at all, since the data is valid.

Thanks for any suggestions. It has been so long since I have used this that I have forgotten all the gotchas.

Brian Begy
BugSentry - Automatic error reporting
 
Can you do this:[tt]

foo = rstEqpt("PL2") & ""

if foo = "" then
Response.Write "No foo"
else
Response.Write "foo = " & foo
end if
[/tt]
 
So this is not totally random but only blows up when PL1 is null and PL2 is 12? Or does it work sometimes when those are the same variable values? For that matter, what is the value of request.QueryString("CloneFrom") when it blows up (and even when it doesn't)?


------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top