Boolean column not working?

jal

Registered User.
Local time
Today, 07:10
Joined
Mar 30, 2007
Messages
1,709
My Access table has a boolean column called "Processed", visible in datasheet view as a column of checkboxes.

SELECT * FROM FileNames WHERE Processed = False

I'm executing this query from VB.Net using an OleDBdataAdapter and DataTable.

I was hoping to deploy this app to a user today but I'm running into a problem. In my test data, there are three records where Processed = false (no visible checkmarks onscreen). Yet the query is only returning two of the records.

I suspected maybe one of the records is null rather than false (but this shouldn't happen because the column has a default value of false). So I ran this query:

SELECT Count(*) FROM FileNames WHERE Processed Is NULL

Returns a count of zero. So finally in desperatation I ran this query:

SELECT count(*) FROM FileNames WHERE Processed = true

Returns a count of 1. Why? I'm looking at the table in datasheet view (the table itself, not a form or subform). None of the checkboxes are ticked. All should therefore have a value of false or possbiy null. How is it that one of the checkboxes is returning "true" ?




 
Ok, the plot thickens. When I paste the query into SQL view it works fine:

SELECT count(*) FROM FileNames WHERE Processed = true

It's only when running it from VB.Net that I have a problem. I'm lost here.
 
Nevermind, sorry for the false alarm. I think it was a concurrency issue. When testing I think I cleared the checkboxes while the VB.Net app was still connected to the DB. As a result, a dirty row probably wasn't showing as dirty in VB.Net. When I closed the app and restarted, I got the right results.
 
As a double check you could state Where Processed <> True This should capture the null's and no's

David
 

Users who are viewing this thread

Back
Top Bottom