Ms-access – Insert default values in a column (access db)

alterms-access

How can I do for inserting a Default Value into a column of a table in Access?
I use this instruction:

ALTER TABLE Tabella ADD Campo Double DEFAULT 0
ALTER TABLE Tabella ADD Campo Double DEFAULT (0)
ALTER TABLE Tabella ADD Campo DEFAULT 0
ALTER TABLE Tabella ADD Campo DEFAULT (0)
ALTER TABLE Tabella ADD Campo SET DEFAULT 0
ALTER TABLE Tabella ADD Campo SET DEFAULT (0)

but all of these cause error. How can I do for doing it?

Best Solution

From MSDN:

The DEFAULT statement can be executed only through the Access OLE DB provider and ADO. It will return an error message if used through the Access SQL View user interface.

Sooo... tell us more about what you're doing and how you're executing your SQL?

And why aren't you using the table designer?

Related Question