473,809 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Show region not showing

The code below is 2 rows in a table, the top row contains a message to be
shown if the recordset returns no matches. The 2nd row will display any
matches.

Problem is that if no matches are found nothing is displayed in this table.
I have used the code that DMX generates using the server behaviour 'Show
region if recordset is empty', but no success.

Appreciate someone pointing out where I'm going wrong here.

Thanks
David

<table>
<tr>
<td>
<% If rsOrg.EOF Or rsOrg.BOF Then >
Sorry, no records were found to match your search.
<% End If ' end rsOrg.EOF And rsOrg.BOF %</td>
</tr>
<tr>
<td>
<% If Not rsOrg.EOF Or Not rsOrg.BOF Then %>
<a
href="<%=(rsOrg .Fields.Item("W eb").Value)%>"> <%=(rsOrg.Field s.Item("OrgName "
).Value)%></a>
<% End If ' end Not rsOrg.EOF Or NOT rsOrg.BOF %>
</td>
</tr>
</table>

http://www.boatingdirectory.com.au/aust_index.asp
Jul 19 '05 #1
5 2283
Try dropping the .BOF stuff and also make sure that your ASP tags are closed
properly. (I'll assume that the ones below that aren't closed properly is
because you didn't actually copy your code.) Also, instead of having two
separate ifs, try an if/else. One of the conditions will always be true
then.
<table>
<tr>
<td>
<% If rsOrg.EOF Then %>
Sorry, no records were found to match your search.
<% Else %>
<a
href="<%=(rsOrg .Fields.Item("W eb").Value)%>"> <%=(rsOrg.Field s.Item("OrgName "
).Value)%></a>
<% End If %>
</td>
</tr>
</table>

Your best bet is to drop DMX for writing your code. It'll make things a
little harder to do at first, but you'll benefit much more in the future.

Ray at home
"David Ehmer" <eh***@optusnet .com.au> wrote in message
news:3f******** *************** @news.optusnet. com.au...
The code below is 2 rows in a table, the top row contains a message to be
shown if the recordset returns no matches. The 2nd row will display any
matches.

Problem is that if no matches are found nothing is displayed in this table. I have used the code that DMX generates using the server behaviour 'Show
region if recordset is empty', but no success.

Appreciate someone pointing out where I'm going wrong here.

Thanks
David

<table>
<tr>
<td>
<% If rsOrg.EOF Or rsOrg.BOF Then >
Sorry, no records were found to match your search.
<% End If ' end rsOrg.EOF And rsOrg.BOF %</td>
</tr>
<tr>
<td>
<% If Not rsOrg.EOF Or Not rsOrg.BOF Then %>
<a
href="<%=(rsOrg .Fields.Item("W eb").Value)%>"> <%=(rsOrg.Field s.Item("OrgName " ).Value)%></a>
<% End If ' end Not rsOrg.EOF Or NOT rsOrg.BOF %>
</td>
</tr>
</table>

http://www.boatingdirectory.com.au/aust_index.asp

Jul 19 '05 #2
Thanks Ray

Good suggestions, which I've implemented but it hasn't changed the result.
Seems illogical that it doesn't display the no matches text. I guess I'm
missing something obvious.

David
"Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
news:Od******** ******@TK2MSFTN GP11.phx.gbl...
Try dropping the .BOF stuff and also make sure that your ASP tags are closed properly. (I'll assume that the ones below that aren't closed properly is
because you didn't actually copy your code.) Also, instead of having two
separate ifs, try an if/else. One of the conditions will always be true
then.
<table>
<tr>
<td>
<% If rsOrg.EOF Then %>
Sorry, no records were found to match your search.
<% Else %>
<a
href="<%=(rsOrg .Fields.Item("W eb").Value)%>"> <%=(rsOrg.Field s.Item("OrgName " ).Value)%></a>
<% End If %>
</td>
</tr>
</table>

Your best bet is to drop DMX for writing your code. It'll make things a
little harder to do at first, but you'll benefit much more in the future.

Ray at home
"David Ehmer" <eh***@optusnet .com.au> wrote in message
news:3f******** *************** @news.optusnet. com.au...
The code below is 2 rows in a table, the top row contains a message to be shown if the recordset returns no matches. The 2nd row will display any
matches.

Problem is that if no matches are found nothing is displayed in this

table.
I have used the code that DMX generates using the server behaviour 'Show
region if recordset is empty', but no success.

Appreciate someone pointing out where I'm going wrong here.

Thanks
David

<table>
<tr>
<td>
<% If rsOrg.EOF Or rsOrg.BOF Then >
Sorry, no records were found to match your search.
<% End If ' end rsOrg.EOF And rsOrg.BOF %</td>
</tr>
<tr>
<td>
<% If Not rsOrg.EOF Or Not rsOrg.BOF Then %>
<a

href="<%=(rsOrg .Fields.Item("W eb").Value)%>"> <%=(rsOrg.Field s.Item("OrgName "
).Value)%></a>
<% End If ' end Not rsOrg.EOF Or NOT rsOrg.BOF %>
</td>
</tr>
</table>

http://www.boatingdirectory.com.au/aust_index.asp


Jul 19 '05 #3
David Ehmer wrote:
The code below is 2 rows in a table, the top row contains a message
to be shown if the recordset returns no matches. The 2nd row will
display any matches.

Problem is that if no matches are found nothing is displayed in this
table. I have used the code that DMX generates using the server
behaviour 'Show region if recordset is empty', but no success.

Appreciate someone pointing out where I'm going wrong here.

Thanks
David

I am assuming you have a scrollable cursor, and that some recordset
navigation has taken place before this block of code, explaining the need to
test both EOF and BOF.
<% If rsOrg.EOF Or rsOrg.BOF Then >
The "Or" should be "And" here. Your recordset contains no records only if
BOTH EOF and BOF are true, so you need to use "And". If some previous code
in this page had looped through the recordset so that it was at EOF, then
you would get the "no records" message when there actually were records.
Sorry, no records were found to match your search.
<% End If ' end rsOrg.EOF And rsOrg.BOF %</td>
</tr>
<tr>
<td>
<% If Not rsOrg.EOF Or Not rsOrg.BOF Then %>


This If statement will allow the following line of code to run if either EOF
or BOF is true, which will raise an error.
With that in mind, let's analyze this statement:

Assume that the previous code had looped through the recordset until the
recordset was at EOF (EOF = true). The first boolean expression, Not
rsOrg.EOF, will evaluate to False. So far so good.
However, the second expression, Not rsOrg.BOF, will evaluate to True! Not
good, because the Or operator has been used, causing the entire espression
to evaluate to True (Or causes the expression to be True if at least one of
the sub-expressions is True). So the following statement will be executed,
and an error will be raised when the field values are attempted to be read.

A better way to write to write this statement would be

If Not (rsOrg.EOF Or rsOrg.BOF) Then

Now if either EOF or BOF is true, the expression in the parentheses will
evaluate to True. The Not will change the result to False, and the following
code will not run. Conversely, if neither EOF and BOF is true, then the
parenthetical expression will evaluate to False, and the Not will change it
to True, allowing the following code to run.

However, I do not believe we have found your problem yet. How are you
verifying that the recordset actually contains records?

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #4
There must be an HTML issue (have you viewed source) or something else that
is preventing the whole block of code from running. Is that code all in an
IF block as well? If so, look at that condition. Or take this code out and
put it in its own page by itself to see what happens.

Ray at home

"David Ehmer" <eh***@optusnet .com.au> wrote in message
news:3f******** *************** @news.optusnet. com.au...
Thanks Ray

Good suggestions, which I've implemented but it hasn't changed the result.
Seems illogical that it doesn't display the no matches text. I guess I'm
missing something obvious.

David
"Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
news:Od******** ******@TK2MSFTN GP11.phx.gbl...
Try dropping the .BOF stuff and also make sure that your ASP tags are

closed
properly. (I'll assume that the ones below that aren't closed properly is
because you didn't actually copy your code.) Also, instead of having two separate ifs, try an if/else. One of the conditions will always be true
then.
<table>
<tr>
<td>
<% If rsOrg.EOF Then %>
Sorry, no records were found to match your search.
<% Else %>
<a

href="<%=(rsOrg .Fields.Item("W eb").Value)%>"> <%=(rsOrg.Field s.Item("OrgName "
).Value)%></a>
<% End If %>
</td>
</tr>
</table>

Your best bet is to drop DMX for writing your code. It'll make things a
little harder to do at first, but you'll benefit much more in the future.
Ray at home
"David Ehmer" <eh***@optusnet .com.au> wrote in message
news:3f******** *************** @news.optusnet. com.au...
The code below is 2 rows in a table, the top row contains a message to

be shown if the recordset returns no matches. The 2nd row will display any matches.

Problem is that if no matches are found nothing is displayed in this

table.
I have used the code that DMX generates using the server behaviour 'Show region if recordset is empty', but no success.

Appreciate someone pointing out where I'm going wrong here.

Thanks
David

<table>
<tr>
<td>
<% If rsOrg.EOF Or rsOrg.BOF Then >
Sorry, no records were found to match your search.
<% End If ' end rsOrg.EOF And rsOrg.BOF %</td>
</tr>
<tr>
<td>
<% If Not rsOrg.EOF Or Not rsOrg.BOF Then %>
<a

href="<%=(rsOrg .Fields.Item("W eb").Value)%>"> <%=(rsOrg.Field s.Item("OrgName "
).Value)%></a>
<% End If ' end Not rsOrg.EOF Or NOT rsOrg.BOF %>
</td>
</tr>
</table>

http://www.boatingdirectory.com.au/aust_index.asp



Jul 19 '05 #5
Thanks for the suggestions.

I tried applying the show/if code block to the whole table to display
records and using an else structure to display a 2nd table with the 'no
matches' text. Worked ok then.

David
"Bob Barrows" <re******@NOyah oo.SPAMcom> wrote in message
news:Ot******** *****@tk2msftng p13.phx.gbl...
David Ehmer wrote:
The code below is 2 rows in a table, the top row contains a message
to be shown if the recordset returns no matches. The 2nd row will
display any matches.

Problem is that if no matches are found nothing is displayed in this
table. I have used the code that DMX generates using the server
behaviour 'Show region if recordset is empty', but no success.

Appreciate someone pointing out where I'm going wrong here.

Thanks
David

I am assuming you have a scrollable cursor, and that some recordset
navigation has taken place before this block of code, explaining the need

to test both EOF and BOF.
<% If rsOrg.EOF Or rsOrg.BOF Then >
The "Or" should be "And" here. Your recordset contains no records only if
BOTH EOF and BOF are true, so you need to use "And". If some previous code
in this page had looped through the recordset so that it was at EOF, then
you would get the "no records" message when there actually were records.
Sorry, no records were found to match your search.
<% End If ' end rsOrg.EOF And rsOrg.BOF %</td>
</tr>
<tr>
<td>
<% If Not rsOrg.EOF Or Not rsOrg.BOF Then %>


This If statement will allow the following line of code to run if either

EOF or BOF is true, which will raise an error.
With that in mind, let's analyze this statement:

Assume that the previous code had looped through the recordset until the
recordset was at EOF (EOF = true). The first boolean expression, Not
rsOrg.EOF, will evaluate to False. So far so good.
However, the second expression, Not rsOrg.BOF, will evaluate to True! Not
good, because the Or operator has been used, causing the entire espression
to evaluate to True (Or causes the expression to be True if at least one of the sub-expressions is True). So the following statement will be executed,
and an error will be raised when the field values are attempted to be read.
A better way to write to write this statement would be

If Not (rsOrg.EOF Or rsOrg.BOF) Then

Now if either EOF or BOF is true, the expression in the parentheses will
evaluate to True. The Not will change the result to False, and the following code will not run. Conversely, if neither EOF and BOF is true, then the
parenthetical expression will evaluate to False, and the Not will change it to True, allowing the following code to run.

However, I do not believe we have found your problem yet. How are you
verifying that the recordset actually contains records?

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2511
by: Ajai Kumar .R | last post by:
Hai all, I've two or more forms on my app. My requirement is, Have to show the first form asa the user press a button have to hide the first form and show the second form. If the user press the escape key on second form, this should be hidded and should show the first form.... Can some one guide me how to achive this... (MUST USE SHOW & HIDE FORM PROPERTIES). I tried to achive this using the below code but when i check the Windows->Task...
6
2011
by: R. Stormo | last post by:
I have a problem showing output that is comming from a script. If I make a script running at commandline it do work and everything are showing. But when I try to execute it from within my proggy it would not show. I have tried to save the outout to a file and again, when I runit from commandline it do save everything but from software it would not. It do only show things that are outputed with "echo" My routine for showing the file are,...
27
1863
by: Just Me | last post by:
I made a Usercontrol that must have AutoScroll set to true when it is used. So I set it to True in the Load event. However the property still shows in the properties window when the control is placed on a form. That's confusing. How can I make that property not show in the properties window?
2
2523
by: Mark Denardo | last post by:
Hi, I need some expert GDI+ person to help me with my RoundOffImage Function: What I'm trying to do is take in an image, crop off the edges around an ellipse region I set up, and then return the cropped image from the function. I sort of have this working, but not thoroughly. If I take the output image of this function and draw it on my form it shows the clipped image as transparent as I am wanting it. But if I take that image and...
0
1445
by: Kristian Frost | last post by:
Hi, I'm just getting started with VB.Net, and I'm having trouble getting the routing around of some of the data straight in my mind, which has led me to the following problem. Basically, I'm trying to create an object that will monitor the status of some switches. I created a User Control to put into a form, on which I want to have five graphical representations of LEDs, which I've got working, light up and turn off when the...
6
4197
by: Norman | last post by:
Hello, I have a working Show / Hide form, that works on FF, but what I would like to do is to be able to display one part when a user clicks on one radio button and display another part when the user clicks on the second radio button - here is the code which just shows / hides the whole form: <script type="text/javascript"> <!-- var dl_elements = new Array('dl_address_country',
4
1671
by: jmartmem | last post by:
Greetings, I have an ASP Insert Record Form that I wish to build the following functionality... On the form is a list/menu (PIC_ITRequired) that has two options: 'Yes' and 'No'. When a user selects 'Yes', I then want a specific text field (ITG_No) -- which is hidden on the base form -- to appear. If the user selects 'No', I want a different text field (ITG_No2) to appear. I have some knowledge to alter code for the 'Show Region' server...
1
4390
by: asharda | last post by:
I have a custom property grid. I am using custom property grid as I do not want the error messages that the propertygrid shows when abphabets are entered in interger fields. The custom property grid doesn't show colloections i.e. if I have a List<Objectthen the Collection is shown but when I click on the "..." button next to it nothing comes up. If I say CustomPropertyGrid p = new CustomPropertyGrid(); p.SelectedObject = new...
6
2265
by: sureshl | last post by:
In my calandar_selectionchanged event .. am showing a div region in my page on the top of the calendar . Like www.bytes.com on clicking Login You will find a small page opens similarly which i want Sameway, i want to open a div region on below to the selected date...how can it be made .. am using vs2005 vb.net code ajax ... This is the div region should open on every calendar_selectionchanged event... <div id="daydetail"...
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10635
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10378
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7653
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3013
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.