"Andy Lav Jr." <alj@johnwkennedyco.com> wrote in
message news:gpf6l6$qkr$1@forums.macromedia.com...
> I am trying to write a script for a web page connected
to an Access
> database using Dreamweaver 8 that will replace a cost of
$0.00 with "Call For
> Pricing".
>
> I have it working to the point where it will display
either the price of
> the first item on the list or the "Call For Pricing"
message for all items in
> the table but it won't display both the message when it
is applicable or the
> actual listed price of each item as it appears in the
database table according
> to the conditions stated.
>
> What am I doing wrong? I attached the code I wrote for
it but I am not
> even sure if I am headed in the right direction as I
have also tried variations
> but get the same result.
>
> Andy
>
> <%
> Dim rsCourses
> Dim rsCourses_cmd
> Dim rsCourses_numRows
>
> Set rsCourses_cmd = Server.CreateObject
("ADODB.Command")
> rsCourses_cmd.ActiveConnection = MM_dsnTech_STRING
> rsCourses_cmd.CommandText = "SELECT * FROM Courses WHERE
CCode Like
> 'TC'+'%'"
> rsCourses_cmd.Prepared = true
>
> Set rsCourses = rsCourses_cmd.Execute
> rsCourses_numRows = 0
> %>
> <%
> If (rsCourses.Fields.Item("CourseCost").Value = 0) Then
> rsCourses_CFP = "Call For Pricing"
> ElseIf (rsCourses.Fields.Item("CourseCost").Value
<> 0) Then
> rsCourses_CFP =
FormatCurrency((rsCourses.Fields.Item("CourseCost").Value), 2,
> -2, -2, -2)
> End If
> %>
>
How about just using Else?
<%
If (rsCourses.Fields.Item("CourseCost").Value = 0) Then
rsCourses_CFP = "Call For Pricing"
Else
rsCourses_CFP =
FormatCurrency((rsCourses.Fields.Item("CourseCost").Value), 2, -2,
-2, -2)
End If
%>
--
Ken Ford
Adobe Community Expert - Dreamweaver/ColdFusion
Adobe Certified Expert - Dreamweaver CS3
Adobe Certified Expert - ColdFusion 8
Fordwebs, LLC
http://www.fordwebs.com
http://www.cfnoob.com