SQL criteria for MS Access boolean field

J

Jerry

Hi,

I am having a problem determining the syntax of an ADO.NET command object.
The Access table has a name field and a field called "ActiveMember" which is
a boolean type field (Shows up as a checkmark in Access).
If I wish to create a Select command which collects all the ActiveMembers
what do I use in the parameter (ActiveMember = ?)
"True" and "Yes" are causing an SQL syntax error.

Thanks
 
H

Herfried K. Wagner [MVP]

Hello,

Jerry said:
Sorry Mr board policeman. I failed to mention I AM USING VB.NET!
ADO.NET is a subset of VB.NET when using VB.NET as a language.

No. VB .NET is one of the programming languages which can be used to
use the ADO .NET technology. You will more likely get an answer in the
ADO .NET ngs.
I am entering this parameter into the command object using VB.NET!
Other languages have different ways of entering parameters, so this may be
specific to VB.NET! Did I mention VB.NET?

....

Regards,
Herfried K. Wagner
 
H

Herfried K. Wagner [MVP]

Hello,

Jerry said:
Show me a VB.NET program worth anything which does not use
ADO.NET and I will agree with you.

ROFLMAO

Regards,
Herfried K. Wagner
 
C

Cindy Meister -WordMVP-

Hi Jerry,
I collected all the records in the SQL statement and then put a RowFilter on
the table with a "ActiveMember = True" filter. It worked. Fortunately it is
a small file.
I checked and rechecked the SQL. "WHERE (ActiveMember = True)" works great
in Access 2000, but not on a .NET Command Object.
Access 2000 won't necessarily export its "Boolean" as True or Yes. Usually it
will be 1 or -1 (I forget which; that's why it's usually "safer" to test on
False, which is always exported as 0).

BTW, I think this was changed in Access 2002 (breaking a couple of mail merge
things I have), where it exports as "Yes".

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top