Forums
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>
< If Recordset1.Fields.Item("section" = "category1" Then >
<span class="smallheader"><=Truncate((Recordset1.Fields.Item("title".Value),20,42)></span><br>
<span class="smlgrey"><%=Truncate((Recordset1.Fields.Item("body".Value),110,140)></span>
[ <a href="news.asp">more</a> ]
< Else >
No Articles at this time
< End If >
</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
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!
My main problem is when I say if a recordset field value is blank do this. Sometimes it does, other times not!