I have a problem loading the page I have a similar error message actually a lot here on the site the same time each line is a different problem message is:
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record: line 60 attaches to the line.
line 60:
SelectedCategoryID = RSCategories("CategoryID")
Before using recordset data, always perform a check if recordset is not eof e.g.
if not RSCategories.eof then
SelectedCategoryID = RSCategories("CategoryID")
end if
Related
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.
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.
I've had a set of legacy pages running on my IIS7 server for at least a year. Sometime last week something changed and now this line:
Response.Write CStr(myRS(0).name) & "=" & Cstr(myRS(0).value)
which used to return nothing more exciting than the string: 'Updated=true' (the sproc processing input params, stores them to a table, checks for errors and when that's all done returns a success code by executing this statement:
select 'true' as [Updated]
Now my pageside error handler is being involved and offers:
myError=Error from /logQuizScore.asp
Error source: Microsoft VBScript runtime error
Error number: 13
Error description: Type mismatch
Important to note that all lots of pages use the same framework - same db, same coding format, connecitonstrings and (so far as I can tell) all others are working.
Troubleshot to this point:
The call to the stored procedure is working correctly (stuff is stored to the given table). The output from the stored procedure is working correctly (i can execute a direct call with the given parameters and stuff works. I can see profiler calling and passing. I can replace all code with 'select 'true' as updated' and the error is the same.
everything up to the response.write statement above is correct.
So something changed how ADO renders that particular recordset.
So i try: Response.Write myRS.Item.count
and get:
Error number: 424
Error description: Object required
The recordset object seems not to be instantiating but the command object _did execute. Repeat - lots of other pages just the same basic logic to hit other sprocs without a problem.
full code snippet
set cmd1 = Server.CreateObject("ADODB.Command")
cmd1.ActiveConnection = MM_cnCompliance4_STRING
cmd1.CommandText = "dbo._usp_UserAnswers_INSERT"
...
cmd1.CommandType = 4
cmd1.CommandTimeout = 0
cmd1.Prepared = true
set myRS = cmd1.Execute
Response.Write CStr(myRS(0).name) & "=" & Cstr(myRS(0).value)
It seems to me that the sproc has changed and returns a scalar instead of a result set.
Changing CommandType = 1 (adCmdText) is need to match with your query changed to SELECT 'whateveryouwannatry' AS [updated].
Since you stated that nothing in the asp code changed we can rule out that the return type of your command/sproc was altered by specifying an output parameter.
I've begun using ASPUnit to unit test my classic ASP code. This is all good and I'm happy. The only problem is with the error messages it displays when a test generates a runtime error. For example, if I've not defined a variable somewhere in my function I get the error:
Microsoft VBScript runtime error (500): Variable is undefined
What would be more useful is if it could tell me which file/line the error occurred on. I know that I can get this information from the ASPError object which is returned by the Server.GetLastError() and elsewhere in my project I have a custom 500 error page which makes use of this method to automatically report crashes to Fogbugz. However when I try to access Server.GetLastError anywhere else the information returned is blank. For example, the following code will output zero rather than the expected 4.
<%
Option Explicit
On Error Resume Next
aVariable = "hello"
Dim errObj : Set errObj = Server.GetLastError()
Response.Write errObj.Line
%>
Is this the correct way to access ASPError or is it only possible on custom error pages? Is there a better way to get error messages reported within ASPUnit?
To the best of my knowledge the ASPError object does not get populated until your current page finished processing. Its meant to only be used on the 500 error page only. So theory is when you get an error if you've set up your 500 page then IIS will do an internal redirect to that page to allow you to at least record the error. Then and only then is the ASPError object available. I've had crazy ideas of using a xmlhttprequest to try to grab the page but thats just not the way it works.
In short there is not much you can do to get that error message details that you want.
Using JScript server side you can use try catch's which give you access to a exception object but even thats not much good to you, no line numbers or anything. Rubbish.
I'm receiving suddenly this error on a Win2003 Server Web Application:
Microsoft VBScript runtime error '800a0006'
Overflow: 'Appname'
A bunch of updates where performed on this server but I have rolled them back all.
The page is old ASP code and if i run file monitor utility it will show the BUFFER OVERFLOW when it hits a GIF.
Any ideas?
Microsoft VBScript runtime error '800a0006' almost always indicates a divide by zero error.
You can reproduce the Overflow error like this :
Dim testVar
testVar = 99999
testVar = CInt(testVar)
So, maybe this indicates there are some problems with the data types where you are setting some variables on that file?
Can you figure out where in the file the error is happening? You can use
Response.Write "here"
Response.End
And then load the page to see what point it gets to. Then you can post the code that is crashing and we may be able to help you more.
You may have a function with Out of Range variable
If you used integer variable and the variable posses greater than
integer range then its shows error.
Explanation:
Dim IntVar AS Integer
IntVar = 50000
Then it must show overflow error
So you can use following code instead of given code
Dim LongVar As Long
longVar = 50000
I got this error
Response object error 'ASP 0156 : 80004005'
Header Error
/ordermgmt/updateorderstatus.asp, line 1390
The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
I put Response.Buffer=true;
Stilll it is showing error.
I have put reponse,Redirect # this line number and that will be executed a number of times (it is in a loop).,After the first iteration it is showing this error
Yes buddies, Its Fixed.Before Response.Buffer ,i included another file.Now i changed it to below the Response.Buffer=True line .Its working now .Thanks
Check that you're not outputting anything at all - even a blank line before your start ASP tag will cause this problem.
The first Response.Redirect changes the headers (and probably forces a Flush, because with a redirect, there can be no content).
The second Response.Redirect changes the headers again (probably to the same thing, but that doesn't matter, as the header were written during the Flush())
You have to enable buffering on specific page, then you can remove this error like:
<% Response.Buffer = True %>
on top of the ASP form
The same applies if you are using Response.Flush()
Set the property storage enabled = true in IIS > ASP > Storage enabled