Solved

BOF or EOF

Posted on 2006-11-03
8
320 Views
Last Modified: 2006-11-18
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
0
Comment
Question by:thatelvis
  • 5
  • 3
8 Comments
 
LVL 16

Accepted Solution

by:
CWS (haripriya) earned 125 total points
ID: 17872170
First check whether the recordset is empty or not like this:


<%
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
%>
0
 
LVL 1

Author Comment

by:thatelvis
ID: 17873207
Cyberweb Thank you,
have a great weekend.

regards

Kenny
0
 
LVL 1

Author Comment

by:thatelvis
ID: 17873380
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
%>
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 17873518
<%
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!
:-)
0
 
LVL 1

Author Comment

by:thatelvis
ID: 17873578
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
%>
0
 
LVL 1

Author Comment

by:thatelvis
ID: 17873793
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

0
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 17879129
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
0
 
LVL 1

Author Comment

by:thatelvis
ID: 17879594
Thanks I totally understand , have a great week.

regarsd

Kenny
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Where is this variable set with(in) php SMARTY? 5 165
Replace Dreamweaver with what? 8 169
Magento as industry internet resource portal? 6 47
What is the Best Web Design Tool 1 62
When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question