Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Boolean Column using DAO 1

Status
Not open for further replies.

waytech2003

Programmer
Joined
Jul 14, 2003
Messages
316
Location
US
I am using VB6 DAO 3.6 and need to add a new True/False field to an existing table.

I have used "ALTER TABLE" to add TEXT fields, but I can not figure out how to add a boolean field.

I have tried
==========================================================
db.Execute ("ALTER TABLE Customer ADD COLUMN [Test] Boolean")==========================================================

But I get an error #3292 "Syntax error in field definition"

How do I make a Boolean field?
 
db.Execute ("ALTER TABLE Customer ADD COLUMN [Test] [!]Bit[/!]")

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
gmmastros

That worked perfectly. Thank you
 
If this is an Access database, you might try YesNo as your datatype.

Kevin
 
Kevin

Yes it is an Access database, and yes that works too.
 
I am more familiar with Microsoft SQL Server (where you have bit fields). I did run this against an Access database before posting, and it worked. Not all SQL that works on Access also works on SQL Server.

Thanks for the star.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top