Forums

ASP

This topic is locked

Another If, Then, Else problem... *sigh*

Posted 20 Aug 2003 07:57:46
1
has voted
20 Aug 2003 07:57:46 sennan lagaluga posted:
Hi Guys,

hopefully someone can help me with my problem, it's driving me batty trying to figure it out
(geez i hate being a noob.)

Okay, I have a table within a database called Table_articles, within the table i have the columns 'id, title, entered, body, author, section' now all i want to do is display a record if the section equals a value within the recordset eg:

<pre id=code><font face=courier size=2 id=code>
&lt; If Recordset1.Fields.Item("section" = "category1" Then &gt;
&lt;span class="smallheader"&gt;&lt;=Truncate((Recordset1.Fields.Item("title".Value),20,42)&gt;&lt;/span&gt;&lt;br&gt;
&lt;span class="smlgrey"&gt;&lt;%=Truncate((Recordset1.Fields.Item("body".Value),110,140)&gt;&lt;/span&gt;
[ &lt;a href="news.asp"&gt;more&lt;/a&gt; ]
&lt; Else &gt;
No Articles at this time
&lt; End If &gt;
</font id=code></pre id=code>

I only have 3 different values (category1, 2 and 3) within my sections and none of them work, it only ever displays 'No Articles at this time'... I have no idea where i could be messing up.

Edited by - sennan on 20 Aug 2003 07:59:28

Replies

Replied 20 Aug 2003 16:21:32
20 Aug 2003 16:21:32 Vince Baker replied:
Try changing the following:

If Recordset1.Fields.Item("section"

to

If Recordset1.Fields.Item("section".value

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 21 Aug 2003 08:41:25
21 Aug 2003 08:41:25 sennan lagaluga replied:
thanks bakerv... no luck im afraid <img src=../images/dmxzone/forum/icon_smile_dissapprove.gif border=0 align=middle>

Replied 28 Aug 2003 10:24:17
28 Aug 2003 10:24:17 Bec C replied:
No help I can offer I am afraid but I get similar problems when testing for different values.

My main problem is when I say if a recordset field value is blank do this. Sometimes it does, other times not!

Reply to this topic