Print Page | Close Window

show no shipping text

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=12606
Printed Date: 30 March 2026 at 9:50pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: show no shipping text
Posted By: Lucent
Subject: show no shipping text
Date Posted: 19 November 2004 at 1:10pm

hi I have a database with some products that are free shipping.

I did this coding to have it show free shipping, but didn't work, and the error kept on point at the end if.

<% 'Show noshipping text
call opendb()
mySQL="SELECT noshippingtext FROM products WHERE idproduct=" &pidProduct
set rs=conntemp.execute(mySQL)
pnoshippingtext=rs("noshippingtext")
If pnoshippingtext="-1" then
response.write "Free Shipping"
end if
call closeDb()
set rs=nothing
'End show short product description %>

any help or pointer would be great, thank you in advance.




Replies:
Posted By: Scotty32
Date Posted: 19 November 2004 at 5:54pm
well first off is the table "noshippingtext" one of those "yes/no" fields?

forgot wot theyre called in MSSQL

anyway if it is try:

<% 'Show noshipping text
call opendb()
mySQL="SELECT noshippingtext FROM products WHERE idproduct=" &pidProduct
set rs=conntemp.execute(mySQL)
If CBool(rs("noshippingtext")) = True then
   response.write("Free Shipping")
end if

call closeDb()
set rs=nothing
'End show short product description %>

the problem is you had quotes round the -1 but itd prob just be easier to use True or False, without quotes as its not a text field - if it is you might wanna add the quotes

also the CBool() will return the value True or False


Posted By: webbasterd
Date Posted: 19 November 2004 at 6:01pm

I had the same problem using true or false values in a MySQL database. I simply solved this by placing 0 or 1 in the table (int value) and queried the database for 0 or 1 (True or false) This worked fine. On the ASP page I have a pulldown menu wit Yes and No and the value behind the pulldown menu is 0 and 1

With kind regards,

Alexander



Posted By: dj air
Date Posted: 19 November 2004 at 6:08pm
Originally posted by Scotty_32 Scotty_32 wrote:

well first off is the table "noshippingtext" one of those "yes/no" fields?

forgot wot theyre called in MSSQL



scotty_32 in MSSQL its a bit field



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net