set default value through alter table

A

andrei

Hi Group,

I'm trying to change the structure of some tables in a mdb file (located at
clients).

1. What is the syntax for setting the default value and a validation rule
for a field when adding the field to a table through DDL ?
Something like this:

2. And also, how can you change the default value property for an existing
field, without dropping/adding the field.

3.Changing the "Required" property: I had a field F1 created with the NOT
NULL option.
If I try
alter table TTEST alter F1 text(35) NULL,
nothing happens - the field has still Required = Yes
Though, if you try the other way, changing a field created with NULL to NOT
NULL, it works...

3. Is there any tutorial on what are the equivalents in DDL for all the
fields in the design of a table (field size, format, input mask, caption,
etc) ?

Note : I can't use ADOX, I have to work with DAO3.6...

Many thanks !

Andrei.
 
M

[MVP] S.Clark

The DDL of Access is fairly limited. If you can get SQL Server Books Online
(BOL) it will give you the gist of what the syntax should be. Not
everything works in Access, though.

I don't know how to answer #2, other than to say that not everything DDL
works in Access.

These things are properties of the tabledef, so you should be able to drill
down via DAO and set them.
 

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