N
Neil
Have an Access MDB (2002/3 format) running against a SQL Server back end,
using ODBC linked tables. Recently upgraded from SQL 7 to SQL 2005.
With the bit fields in SQL Server, even though their values are 0 and 1 for
False and True, the ODBC driver displays them as 0 and -1, which are the
Access False and True values. That was true for SQL 7 as well as for SQL
2005.
However, I find that when I run a query (not a pass-through; just a regular
Access query), I have to use "1" in the Where clause to get True values from
the SQL table, even though they are displayed as -1!
For example, "Select * From MyTable Where SomeBitField=-1" returns no
records; but "Select * From MyTable Where SomeBitField=1" returns records.
However, the records show -1 in the bit field!!!!
If I use True instead of 1 or -1 it works fine. But I have tons of code that
build dynamic SQL that use -1 for true, and I'd have to change all of those.
Also, since the above is true for saved queries as well as dynamic SQL, it
seems to be some sort of glitch (since the saved query would have to have
"1" in the Criteria field, but would display "-1" in the results!).
Does anyone know if this is a known problem and if Microsoft released a
patch or whatever for this? I'm running Access 2003, SP3 (v. 11.8166.8221).
Thanks!
Neil
using ODBC linked tables. Recently upgraded from SQL 7 to SQL 2005.
With the bit fields in SQL Server, even though their values are 0 and 1 for
False and True, the ODBC driver displays them as 0 and -1, which are the
Access False and True values. That was true for SQL 7 as well as for SQL
2005.
However, I find that when I run a query (not a pass-through; just a regular
Access query), I have to use "1" in the Where clause to get True values from
the SQL table, even though they are displayed as -1!
For example, "Select * From MyTable Where SomeBitField=-1" returns no
records; but "Select * From MyTable Where SomeBitField=1" returns records.
However, the records show -1 in the bit field!!!!
If I use True instead of 1 or -1 it works fine. But I have tons of code that
build dynamic SQL that use -1 for true, and I'd have to change all of those.
Also, since the above is true for saved queries as well as dynamic SQL, it
seems to be some sort of glitch (since the saved query would have to have
"1" in the Criteria field, but would display "-1" in the results!).
Does anyone know if this is a known problem and if Microsoft released a
patch or whatever for this? I'm running Access 2003, SP3 (v. 11.8166.8221).
Thanks!
Neil