• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

I am getting the following ADODB.Recordset error '800a0bcd'

I haven't changed anything in our website but for some reason we are getting the error above.  I am new to asp but understand the logic the error we are getting is the following when someone tries to log in.
ADODB.Recordset error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/holiday/adjustleaveadmin.asp, line 100 \

Line 100 looks like this
Function UpdateTable()
Set Rs1 = Server.CreateObject("ADODB.RecordSet")
sSQL = "SELECT * FROM tAdmin WHERE Login='" & EmpNameAdjust & "'"
Rs1.Open sSQL, sDSN, adOpenKeySet, adLockPessimistic, adCmdText
if leaveType = "Sick" then
Rs1("SickTaken") = sLeave_Taken
Rs1("SickOverdue") = overdue
Elseif leaveType = "Vacation" then
Rs1("VacationTaken") = sLeave_Taken
Rs1("VacationOverdue") = overdue
End If
Rs1.Update
Rs1.Close
Set Rs1 = Nothing

0
texasadmin1231
Asked:
texasadmin1231
  • 4
  • 3
  • 2
1 Solution
 
radcaesarCommented:
No Error Handling?

This means the record didn't exists

<% If NOT Rs1.EOF And Rs1.BOF Then %>
0
 
Paul JacksonCommented:
It would seem your query is failing to return a record from the database. You need to put in some debug code to see what is being passed into the where clause of the query.
0
 
texasadmin1231Author Commented:
Ok so the record doesn't exist. I get that part. How do I fix it? be gentle as I am new to asp.:)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
radcaesarCommented:
<% If NOT (Rs1.EOF And Rs1.BOF) Then %>
//Your Logic
<% END IF%>
0
 
texasadmin1231Author Commented:
so the code should look like this?

End Function

Function UpdateTable()
Set Rs1 = Server.CreateObject("ADODB.RecordSet")
sSQL = "SELECT * FROM tAdmin WHERE Login='" & EmpNameAdjust & "'"
Rs1.Open sSQL, sDSN, adOpenKeySet, adLockPessimistic, adCmdText
if leaveType = "Sick" then
Rs1("SickTaken") = sLeave_Taken
Rs1("SickOverdue") = overdue
Elseif leaveType = "Vacation" then
Rs1("VacationTaken") = sLeave_Taken
Rs1("VacationOverdue") = overdue
End If
Rs1.Update
Rs1.Close
Set Rs1 = Nothing
<% If NOT (Rs1.EOF And Rs1.BOF) Then %>
//Your Logic
<% END IF%>

End Function
0
 
radcaesarCommented:
Its not a place for jokes buddy..........
0
 
texasadmin1231Author Commented:
I'm sorry I don't understand your statement radcaesar.
0
 
Paul JacksonCommented:
try this, it will however only stop the error occurring it doesn't solve why you are not getting a record returned. :

Function UpdateTable()
Set Rs1 = Server.CreateObject("ADODB.RecordSet")
sSQL = "SELECT * FROM tAdmin WHERE Login='" & EmpNameAdjust & "'"
Rs1.Open sSQL, sDSN, adOpenKeySet, adLockPessimistic, adCmdText
If NOT (Rs1.EOF And Rs1.BOF) Then
if leaveType = "Sick" then
Rs1("SickTaken") = sLeave_Taken
Rs1("SickOverdue") = overdue
Elseif leaveType = "Vacation" then
Rs1("VacationTaken") = sLeave_Taken
Rs1("VacationOverdue") = overdue
End If
Rs1.Update
Rs1.Close
Set Rs1 = Nothing
END IF

End Function
0
 
texasadmin1231Author Commented:
Thanks Jacko72 also the database is in MS Access. I don't know if that makes a difference. I didn't write the website I'm just trying to fix the error since he's no longer with the company.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now