SQL criteria for MS Access boolean field

  • Thread starter Thread starter Jerry
  • Start date Start date
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
 
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
 
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
 
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 :-)
 
Back
Top