Boolean variable True/false

Reply

Join Date: Jan 2006
Posts: 2
Reputation: Georgina is an unknown quantity at this point 
Solved Threads: 0
Georgina Georgina is offline Offline
Newbie Poster

Boolean variable True/false

 
0
  #1
Jan 20th, 2006
Hi there,
Using DMX4 & MsAccess (ASP VBScript)

i'm trying to show my True/false results as Yes/No. I am trying this at the mo:
<%If(RsNewProds.Fields.Item("Org").Value)=1 Then
Response.Write("Yes") else Response.Write("No")end if%>

but it comes up with error 0x800A0412 at the 'else' bit of the script

Any thoughts??
Thanks
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 483
Reputation: campkev is an unknown quantity at this point 
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Re: Boolean variable True/false

 
0
  #2
Jan 23rd, 2006
asp can appear tempermental with if statements. Try this.
<%
If(RsNewProds.Fields.Item("Org").Value)=1 Then
Response.Write("Yes")
else
Response.Write("No")
end if
%>
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 2
Reputation: Georgina is an unknown quantity at this point 
Solved Threads: 0
Georgina Georgina is offline Offline
Newbie Poster

Re: Boolean variable True/false

 
0
  #3
Jan 23rd, 2006
Thanks it worked!!!
Georgina
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 167
Reputation: Drew is an unknown quantity at this point 
Solved Threads: 7
Drew's Avatar
Drew Drew is offline Offline
Junior Poster

Re: Boolean variable True/false

 
0
  #4
Jan 25th, 2006
Clean it up and do it the right way

  1. <%
  2. If CBool(RsNewProd("Org")) Then
  3. Response.Write("Yes")
  4. Else
  5. Response.Write("No")
  6. End If
  7. %>

The cleaner you code the easier it is to go back and edit things.
Drew Gauderman
ASP / MSSQL Coder
http://www.iportalx.net - My ASP Portal
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC