954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Boolean variable True/false

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

Georgina
Newbie Poster
2 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
 

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
%>

campkev
Posting Pro in Training
484 posts since Jul 2005
Reputation Points: 14
Solved Threads: 19
 

Thanks it worked!!!
Georgina

Georgina
Newbie Poster
2 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
 

Clean it up and do it the right way :)

<%
If CBool(RsNewProd("Org")) Then
	Response.Write("Yes")
Else
	Response.Write("No")
End If
%>


The cleaner you code the easier it is to go back and edit things.

Drew
Junior Poster
166 posts since Apr 2004
Reputation Points: 25
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You