11-12-2008 10:54 PM
Hello,
I am trying to get a bit value (ture/false) from SQL Server 2005 in CVI (with SQL toolkit). I am using the DBBindInt, but throughout the return value is -1.
How can I get the real value from SQL?
Thanks for your help
ReGion
Solved! Go to Solution.
11-13-2008 10:15 AM - edited 11-13-2008 10:19 AM
Do you mean that you never receive a FALSE value, ie 0? Or did you expect a TRUE value to be exactly 1? It is very common for TRUE to be represented as -1; if this worries you just mask off all bits of the returned value except for bit 0 - this will then give your 0/1 alternative.
JR
11-13-2008 07:18 PM - edited 11-13-2008 07:20 PM
Thank you for your help, but you miss my mind.
I mean that the value="true" but the DBBindColInt return value is "-1", and the value="false" but the DBBindColInt return value is "-1" too.
The Qustion is : Which function can get the bit data type?
I used DBColType to get Col's data type, and the return value is "11", that's DB_BOOLEAN data type.
Thanks!
ReGion
11-20-2008 02:20 AM
I used DBBindColInt function, the false return -1 and the true return 0. It's working.
Thank you for your help