1
votes

I have a one liner classic ASP server side code that is failing.

...
result = rs(0)

That is throwing a HTTP 500.100 - Internal Error and I cannot figure it out. I feel like the dumbest web programmer in the universe at the moment. I have introduced error checking as in:

...
On Error Resume Next
result = rs(0)
If Err.Number <> 0 Then
    ...
End If

and the HTTP error still result!

If I run the actual query in MS SQL Server Management Studio I get the expected result (1 row, 1 column result) so it is not the SQL. If I change the code to:

result = rs(1)

the On Error Resume Next code picks up the error as "#3265: Item cannot be found in the collection corresponding to the requested name or ordinal."

If I hard code to:

result = 10.0

I get no error.

Also prior to this one line of code I first check for an existing data row as in:

If Not rs.EOF Then       
   result = rs(0)        
End If

So I can rule out there not being any data.

1

1 Answers

2
votes

Gosh, no wonder I could not find the answer as I had already concluded to eliminate the possible area of concern the DAM SQL!

The precision on the column in question was numeric(19,6) which VBScript could not handle so I casted it to float and all is well.