Classic ASP / MSSQL 2008 conditional check on bit data type throws error when false

Author Message
rdhokpa

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 9/10/2009
  • Status: offline
Classic ASP / MSSQL 2008 conditional check on bit data type throws error when false Thursday, September 10, 2009 7:37 AM (permalink)
0
Dear all,
I have recently run into an issue which I hope you'll be able to help me with. Our company is upgrading from SQL server 7 to SQL Server 2008. We have a classic asp application which compares a bit field in the database and displays content 
based on the condition. Here is an excerpt.

comp_exactAddress = allData(3,rowCounter) //get the bit datafield

if comp_exactAddress then

     //do something

else
     // do something else


THe issue is that when the bit field in the database is true (or 1), the content is displayed, but when the bit filed in the database is false(or 0), classic ASP is throwing an error saying 

Microsoft VBScript runtime error '800a000d'
Type mismatch: 'comp_exactAddress'


Could any of you help me please?
Thanks,
rdhokpa
<message edited by rdhokpa on Thursday, September 10, 2009 7:38 AM>
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9