更新时间:2023-02-06 12:06:16
对 DEFAULT
的支持包含在 Access DDL with Jet 4 (Access 2000) 中.但是,它只能在从 ADO 连接执行的 DDL 中使用.
Support for DEFAULT
was included in Access DDL with Jet 4 (Access 2000). However it can only be used in DDL executed from an ADO connection.
这适用于 Access 2007.
This worked with Access 2007.
CurrentProject.Connection.Execute "ALTER TABLE MyTable " & _
"ALTER COLUMN field2 SET DEFAULT ""foo"";"
请注意,如果您的数据库文件是 Access 97 或更早版本,您将无法从 DDL 设置字段 DEFAULT
值.
Note if your db file is Access 97 or earlier, you won't be able to set a field DEFAULT
value from DDL.