PDA

Click to See Complete Forum and Search --> : Creating a boolean field in access


michelle
Jan 11th, 2000, 04:06 PM
Dear Vb programmers,

I try to create a boolean field in an access .
The next code I made:

Set Ws = DBEngine.Workspaces(0)
Set Db = Ws.CreateDatabase(DbSettings, dbLangGeneral)

SqlSel = "Create Table Customer ( Customer Text"
SqlSel = SqlSel + ", DatumM" + " boolean"
SqlSel = SqlSel + ");"

Db.Execute SqlSel 'creating a table

The boolean is not correct
What do I have to fill in? (You know also the syntax for autonumber?)

Nice greetings,

Michelle.

HarryW
Jan 11th, 2000, 04:31 PM
I've never done anything in Access other than to make databases for use in VB, but what you have there looks a little odd. Usually to add strings you use the & operator, not the +.

Also this line looks strange:

SqlSel = SqlSel + ", DatumM" + " boolean"

Why not just this?

SqlSel = SqlSel + ", DatumM boolean"
(Only maybe it should be:
SqlSel = SqlSel & ", DatumM boolean")