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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BOF, EOF error

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
I have a page that I haven't modified in several days. I was able to login to the site yesturday from my house, but when I tried this morning I get the following error.

Error Type:
ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/am1st/Mystuff/index.asp, line 18


The record I am trying to pull is still in the database.
 
Can you post some of the code? Not enough information to figure out what might be happening.
 
<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<%
Dim dbconn
Dim dbrs

set dbconn = server.createobject(&quot;ADODB.Connection&quot;)
dbconn.Open &quot;Provider=SQLOLEDB;Data Source=AM1ST_FS1;&quot; _
& &quot;Initial Catalog=HRINFO;User Id=sa;&quot; _
& &quot;Connect Timeout=15;&quot;
set dbrs = server.createobject(&quot;ADODB.Recordset&quot;)
dbrs.open (&quot;Select * from employeeinfo where userID = '&quot; & request.servervariables(&quot;AUTH_USER&quot;) & &quot;'&quot;), dbconn, 0, 1
If dbrs.EOF = True Then
dbrs.close
dbrs.open (&quot;Select * from employeeinfo where userID = 'AM1ST_DOMAIN\&quot; & request.servervariables(&quot;AUTH_USER&quot;) & &quot;'&quot;), dbconn, 0, 1
End If
set dbrs2 = server.createobject(&quot;ADODB.Recordset&quot;)
'proplevel=dbrs(&quot;proplevel&quot;).Value
Session(&quot;userID&quot;) = dbrs(&quot;userID&quot;).Value ---------- Error is here
Session(&quot;timelevel&quot;) = dbrs(&quot;timelevel&quot;).Value
Session(&quot;employee&quot;) = session(&quot;whosonline&quot;)
Session(&quot;whosonline&quot;) = dbrs(&quot;loginID&quot;).Value
Session(&quot;loggedIn&quot;) = dbrs(&quot;loginID&quot;).Value
''dbrs = &quot;&quot;

''set dbrs = server.createobject(&quot;ADODB.Recordset&quot;)
%>
 
Ok, I'm not getting many clues out of this. (Granted, I was up early to watch the US win this morning - GO USA!!! - and that might be contributing...) Not sure if this is related, but why do you have &quot;dbrs = &quot;&quot; and no ending quotes? Same goes for next line, &quot;set dbrs = server.createobject(&quot;ADODB.Recordset&quot;) - again without any end quotes. That doesn't look right to me, but not sure if that's causing your problem.

Something else you might try is response.write statements dispersed throughout your code to see what some of your values might be and debug that way. Hope this helps.
 
basically the page has to find a record for dbrs for the page to load. I was pulling this information fine on Friday night and haven't touched the code since and this morning I came in and the page gave me this error.

 
sthmpsn1, your code looks very awful.. sorry for being so blunt.. You can cut down on the complexity and length of your code by using other methods..

You may want to try using the Command objects instead of Recordset objects.. This will be easier for you to debug later.

example:

...
...
set cmd = server.createobject(&quot;ADODB.Command&quot;)
cmd.ActiveConnection = dbconn
...
...

cmd.commandtext = &quot;SELECT * .... &quot;
set rs = cmd.execute

At least this way, you know exactly whats going on and not relying on the Recordset object to get the records your looking for.


Cheers...
 
Is it actually pulling a record? You can check by putting a response.write &quot;There is a record&quot; after you open the recordset each time, and probably number for either first or second attempt. If you don't see this statement on your page when you load, then it's not pulling anything. Your code may not be the issue. But has anything become corrupted (like your data)? Sorry can't offer more help. Maybe someone else has an idea. :-(
 
Ok, I haven't seen that error in a while but i used to know the exact cause of it, so lets see if I can find it again(sorry low on sleep). The error is saying that the recordset pointer is either pointing to a reference before or after the file, but not inside it. If I remember correctly this means your getting a bad recordset back. Since your recordset is not pointing validly, you cannot enter or take out values. I would consider rewriting that portion of the code. I wish I could remember exactly what the error is, but I do know it's null recordset related.
BTW, is there a reason you are declaring dbrs2 as a new recordset without actually dim'ing it or using it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top