Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 booleans playing with my head
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 January 2005 :  17:17:19  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
OK... I have a numeric (long integer) field in a database (Access), with the values being either 1 or 0, no other values anywhere in that column

No matter what I use, I always get True returned; even if the field is 0. I dont get it.. I've tried ALL of the below methods

1

  bSubscribed = rs("N_SUBSCRIBED")

2

  bSubscribed = cBool(rs("N_SUBSCRIBED"))

3

  if Cint(rs("N_SUBSCRIBED")) <> 0 then
    bSubscribed = True
  else
    bSubscribed = False
  end if

4

  if Cint(rs("N_SUBSCRIBED")) = 1 then
    bSubscribed = True
  else
    bSubscribed = False
  end if

-Stim

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 12 January 2005 :  17:56:44  Show Profile  Visit Gremlin's Homepage

If rs("N_SUBSCRIBED") Then 
  bSuscribed = True
Else
  bSubscribed = False
End If

Assuming N_SUBSCRIBED is Boolean would be the easiest. Any reason why your field needs to be Int Long ? seems a little wasteful for just whats seems basically like a "flag" style field.

Kiwihosting.Net - The Forum Hosting Specialists

Edited by - Gremlin on 12 January 2005 17:58:47
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 January 2005 :  18:03:45  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
it is just a flag field, but when I was making the database I didnt know how I was going to use it so I made it a long integer... actually first I made it just text, but then chagned it to integer

-Stim
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07