Forums

This topic is locked

Hide or Show Recordset

Posted 08 Mar 2005 14:32:17
1
has voted
08 Mar 2005 14:32:17 Mashkur Alam posted:
Hi,

Looking for a feature that, hide a recordset or show.

For a Property Site I need to archive properties which are not available.

I have culumn name Archive, value = 0 or 1

If value 0 then do not show, if value = 1 then show the records?

Is this the right way? How can I make the code into the View page? Please advice.

Regards

Babu

Replies

Replied 08 Mar 2005 17:30:21
08 Mar 2005 17:30:21 Simon Martin replied:
There is a server behaviour in DW "Show Region If Recordset is Empty" and another "Show Region If Recordset is Not Empty"
You can wrap your code to display your results up in one of these behaviours, so If you have results then you show them, otherwise you show them some default text that says something like
"No matching records please try again"

The built in tutorials have some very good instructions on setting this up, but if you need any help with the specifics please let us know

Live the life you love
Love the life you live
~ ~ ~ ~ ~ ~ ~
<b>Simon Martin</b> - <i>DMXzone Manager</i>
<font size=1>[ Dreamweaver MX/MX2004 | ASP | SQL | XHTML/CSS | Web Accessibility ] </font id=size1>
Replied 08 Mar 2005 17:40:01
08 Mar 2005 17:40:01 Vince Baker replied:
If you just want to hide all records that have a 0 in them add this as a condition to your recordset:

select *
from yourrecordset
where archive = 1

(if archive is numeric add as above, if it is text place a single quote either side of the 1)

i.e. where archive = '1'

Regards

Vince Baker
<strong>DMX Zone Manager</strong>

[VBScript | ASP | HTML | CSS | SQL | Oracle | AS400 | ERP Logic | Hosting]
Replied 08 Mar 2005 17:40:40
08 Mar 2005 17:40:40 Mashkur Alam replied:
Hi

Thanks for the reply.

I know this Server behaviour.

But this not what I am looking for. Actually, the site is contain Real Estate Business Properties, so database contain more then a 100 properties. What I am looking for is, if one property is being LET then everytime we have remove it from database, but in a 3/6 months later we have bring it back for Re-LET.

Basically, I have to use somekind of Script that HIDE the ROW from Viewing Page with a value added 1/0 from databse. (Which will make it Archive)

(Note: I have seen in other site eg: Righmove admin section, you can easily select a check box to show or hide)
Any advice would be great

Thanks




Babu
Replied 08 Mar 2005 17:43:27
08 Mar 2005 17:43:27 Mashkur Alam replied:
Hi Vince

What will be the condition for hiding one or multiple records which has got value either 1 or 0

Not all records

Thanks

Babu
Replied 08 Mar 2005 17:47:55
08 Mar 2005 17:47:55 Vince Baker replied:
Not sure I understand your response.....

Just to confirm:

You have a table with many properties and you have a field for each with either a 1 (show) or 0 (hide) in them...

You only want to display records (all records) where the value = 1.

You have a recordset on your page getting all records at the moment.

If all the above is correct, add the where archive = 1 line to the bottom of the recordset on your page and it will only display records with a 1 in the archive field.

Is that what you want to do?

Regards

Vince Baker
<strong>DMX Zone Manager</strong>

[VBScript | ASP | HTML | CSS | SQL | Oracle | AS400 | ERP Logic | Hosting]
Replied 08 Mar 2005 17:52:41
08 Mar 2005 17:52:41 Mashkur Alam replied:
Hi Vince

Thanks.

Thats absolutely what I was looking for.

But confuse where to add:

&lt;/body&gt;
&lt;/html&gt;
&lt;%
rsletting_list.Close()
Set rsletting_list = Nothing
%&gt;
where archive = 1

Is that right?




Babu
Replied 08 Mar 2005 17:56:17
08 Mar 2005 17:56:17 Simon Martin replied:
SELECT *
FROM tblProperty
WHERE archive = 1

Live the life you love
Love the life you live
~ ~ ~ ~ ~ ~ ~
<b>Simon Martin</b> - <i>DMXzone Manager</i>
<font size=1>[ Dreamweaver MX/MX2004 | ASP | SQL | XHTML/CSS | Web Accessibility ] </font id=size1>
Replied 08 Mar 2005 17:56:50
08 Mar 2005 17:56:50 Mashkur Alam replied:
Got it.

many many thanks

Babu

Reply to this topic