N
Neil
Rick Brandt said:This is the part of your story I don't understand. I first had bit
problems with Access/SQL Server back when we were using Access 97 and SQL
Server 6.5. In my experience the issue you are complaining about has
*always* been that way. The only difference was when SQL Server 2000
started allowing bit fields to be nullable which caused more (different)
problems with Access.
That's very interesting. I'm aware of the Nullable issue, and none of my bit
fields have ever been Nullable. But that's interesting. I know for a fact
that this happened when we upgraded to SQL 2005. And it wasn't just the
upgrade. Initially the database was in SQL 7 compatibility mode (level 70).
Only when we changed the compatibility mode to 2005 (level 90) did this
problem start.
Again, it makes no sense, since the front end is what's doing the
translating. So why should the change to the back end affect Access from
translating -1 into 1. But such is the case.
I even went back to Access 2000 and tried it there, just to confirm that it
wasn't a change to Access that was causing it. And, sure enough, the code
that worked for years failed when used against the SQL 2005 database,
because -1 was being sent as -1, and was not being translated into 1.
The only way I can think to explain this phenomenon would be that perhaps
Access was never converting the -1 to 1 when I did "...where
SomeBitField=-1", but something in SQL Server did. That is, perhaps SQL
Server's engine said, "Hey, when we get junk Where clauses that use -1, just
treat that as though it were a 1 instead." But then, in SQL 2005, the engine
stopped doing that. That's the only explanation I can think of, since
nothing changed on the Access end.
Neil