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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Try to add colunm of data type Yes/NO

Status
Not open for further replies.

Niebotel

Programmer
Jan 1, 2007
169
0
0
NL
I'm trying to add a column to an existing table:
db.Execute "ALTER TABLE Passanten ADD COLUMN ToeslagBerekend YesNo"
db.TableDefs("Passanten").Fields("ToeslagBerekend").Properties("DefaultValue") = False

The result is confusing:
In the table definition is the datatype Yes/No
In data view there is the value 0 I can change it in -1

In the program where I use the field the value is null

Is my alter table wrong?
 
Hi,

How do you know your value is null?

I've just tried it and the default value is set to 0, which is correct I believe?

Let me knwo and I'll try and help . . . .

Regards,

TheFitz

Fitz
Did you know, there are 10 types of people in this world:
* Those who understand binary
and
* Those who Don't!!
 
Hi Fitz, thanks for responding.
I see the value null in debugging mode.
Another thing what I see is the following; if I add a column in my table direct in the design mode the field is displayed in de dataview as: checkbox and in Design mode as Yes/No
If I use alter Table the field shows a 0 in de data view and JA/Nee (Yes/No)

I would love to sent you the table; but i cannot attach it to this forum.
Attachment uses URL's and that is an unknown way of working for me.
 

ALTER TABLE Passanten ADD COLUMN ToeslagBerekend YesNo DEFAULT (0)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top