Link to home
Start Free TrialLog in
Avatar of thatelvis
thatelvis

asked on

BOF or EOF

Hello,

I have a small problem and would be grateful for some help.

     <% If  cint(Recblockblockunblockif_else.Fields.Item("worker_uid").Value) = cint(Session("pt_login_id"))
 AND  cint(Recblockblockunblockif_else.Fields.Item("blocker_id").Value) = cint(RecmostofDuser.Fields.Item("id_usr").Value) Then  %>
          <h1>free and open</h1><% Else %>this user is blocked <% End If %>

The above works  if  Recblockblockunblockif_else is not empty, but when it is empty I get a Either BOF or EOF is True error, what can I do to it to work if there is no record.

regards and thanks for any help

Kenny
ASKER CERTIFIED SOLUTION
Avatar of CWS (haripriya)
CWS (haripriya)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thatelvis
thatelvis

ASKER

Cyberweb Thank you,
have a great weekend.

regards

Kenny
Hi again, Sorry I jumped the gun a little



the code you helped me with below. I only want one else, where as if the recordset is not empty and has the two values then   <h1>free and open</h1><% Else %>this user is blocked , below you gave me 2 elses, how can I modift it to have only the one else. thanks again.

Kenny




<%
If Recblockblockunblockif_else.EOF = false then

If  cint(Recblockblockunblockif_else.Fields.Item("worker_uid").Value) = cint(Session("pt_login_id"))
 AND  cint(Recblockblockunblockif_else.Fields.Item("blocker_id").Value) = cint(RecmostofDuser.Fields.Item("id_usr").Value) Then  %>
          <h1>free and open</h1><% Else %>this user is blocked
<%
End If
else
%>
<b>No record to display</b>
<%
End if
%>
<%
If Recblockblockunblockif_else.EOF = false then

If  cint(Recblockblockunblockif_else.Fields.Item("worker_uid").Value) = cint(Session("pt_login_id"))
 AND  cint(Recblockblockunblockif_else.Fields.Item("blocker_id").Value) = cint(RecmostofDuser.Fields.Item("id_usr").Value) Then  %>
          <h1>free and open</h1><% Else %>this user is blocked
<%
End If
End if
%>


and thanks for points!
:-)
wowa,

ok when the user is blocked this shows "this user is blocked", but when the user is not blocked it shows nothing where as it should show   <h1>the user is not blocked</h1>, I find this so confusing, sorry to be a bother if you have any ideas i would be grateful, I wish I had given more points for this and didnt mean to close it so soon.

<%
If Recblockblockunblockif_else.EOF = false then

If  cint(Recblockblockunblockif_else.Fields.Item("worker_uid").Value) = cint(Session("pt_login_id"))
 AND  cint(Recblockblockunblockif_else.Fields.Item("blocker_id").Value) = cint(RecmostofDuser.Fields.Item("id_usr").Value) Then  %>
          <h1>the user is not blocked</h1><% Else %>this user is blocked
<%
End If
End if
%>
I have re asked this question in the forum as I needed to resolve this in a hurry, no offence , and thanks for your help.

Kenny

hi kenny,

Sorry there is a delay in answering because of the time difference. When you are working, for me it is bed-time.
I think you would have already solved the problem.

My kind advice, first check the results carefully and then accept the answer.

Good Luck
Thanks I totally understand , have a great week.

regarsd

Kenny