This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > September 2004 > ASP VBScript If Else





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author ASP VBScript If Else
Matt - Stamats

2004-09-29, 7:16 pm

So I have a page that I am working on and I am hainv a problem with a certain
db. record. I have a field called "cancertypes" In this field there are lists
of cancer type IE

breast, gallbladder, bladder, kidney, prostate,liver

So in order to get certain values I had to make the SQL statement

SELECT *
FROM types
WHERE cancertype LIKE '%MMColParam%'
ORDER BY sortOrder ASC, Name ASC

So I am getting some of the values from cancertypes gallbladder and bladder
showing put on the same results pages. So I want to make a VBSCRIPT if else
statements. I changed the value Gallbladder to Gall then I want to make a if
else the says if "cancer type = "gall" response.write "bladder" and add it that
way. Here is the code below. Is this a good fix or does anyone know of anything
better to use?

Thanks
-Matt

<%=(Recordset1.Fields.Item("cancertype").Value)%><%
If (Recordset1.Fields.Item("cancertype").Value) = "Gall" Then
Response.Write "blader"
End If
%>

Paul Whitham TMM

2004-09-29, 7:17 pm

What you have done will work, however you are going to create a lot of
coding work if you abbreviate other names. If you are shortening the name to
help with input why not create a separate table to hold the names and then
link that to a drop down box on the input page.

--
Regards

Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
www.valleybiz.net

Team Macromedia Volunteer for Ultradev/Dreamweaver MX
www.macromedia.com/support/forums/team_macromedia

"Matt - Stamats" <webforumsuser@macromedia.com> wrote in message
news:cjes57$68$1@forums.macromedia.com...
> So I have a page that I am working on and I am hainv a problem with a

certain
> db. record. I have a field called "cancertypes" In this field there are

lists
> of cancer type IE
>
> breast, gallbladder, bladder, kidney, prostate,liver
>
> So in order to get certain values I had to make the SQL statement
>
> SELECT *
> FROM types
> WHERE cancertype LIKE '%MMColParam%'
> ORDER BY sortOrder ASC, Name ASC
>
> So I am getting some of the values from cancertypes gallbladder and

bladder
> showing put on the same results pages. So I want to make a VBSCRIPT if

else
> statements. I changed the value Gallbladder to Gall then I want to make a

if
> else the says if "cancer type = "gall" response.write "bladder" and add it

that
> way. Here is the code below. Is this a good fix or does anyone know of

anything
> better to use?
>
> Thanks
> -Matt
>
> <%=(Recordset1.Fields.Item("cancertype").Value)%><%
> If (Recordset1.Fields.Item("cancertype").Value) = "Gall" Then
> Response.Write "blader"
> End If
> %>
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews