Board index » delphi » setting not null and required properties for a field in access with sql

setting not null and required properties for a field in access with sql

Hello,

is it possible to change the field definition in an access database
(required, not null) using sql?
If not, how can I do this?

Thanks,
Bernaert Dominique.

 

Re:setting not null and required properties for a field in access with sql


Use Alter table alter column. The syntax is:

ALTER TABLE table {ADD {COLUMN field type[(size)] [NOT NULL]     [CONSTRAINT
index] |
    ALTER COLUMN field type[(size)] |
    CONSTRAINT multifieldindex} |
    DROP {COLUMN field I CONSTRAINT indexname} }

Or, you can use ADOX Table and Column objects.

Regards,
Vassiliev V.V.
http://www.oledbdirect.com

"Bernaert Dominique" <dominique.berna...@pandora.be> ???Y/???Y
????? ???Y??: news:3c7dd864_1@dnews...

Quote
> Hello,

> is it possible to change the field definition in an access database
> (required, not null) using sql?
> If not, how can I do this?

> Thanks,
> Bernaert Dominique.

Re:setting not null and required properties for a field in access with sql


Quote
"Vassiliev V.V." <vv_...@iname.com> wrote in message

news:3c7deb4d_2@dnews...
| Use Alter table alter column. The syntax is:
|
| ALTER TABLE table {ADD {COLUMN field type[(size)] [NOT NULL]
[CONSTRAINT
| index] |
|     ALTER COLUMN field type[(size)] |
|     CONSTRAINT multifieldindex} |
|     DROP {COLUMN field I CONSTRAINT indexname} }
|
| Or, you can use ADOX Table and Column objects.

You cannot change the Nullable property on a column that has been appended
to a table.  You must delete the column and recreate it.

--

Quidquid latine dictum sit, altum viditur.
#319

Other Threads