DEFAULT clause in ALTER TABLE statement resulting in syntax error

十年热恋 提交于 2019-12-06 13:38:55

You could do this by using the DAO object.

Microsoft says this about modifying Access tables:

In addition, certain types of Microsoft Access-specific properties, such as the ValidationRule and DefaultValue properties of fields, can be set only through the Microsoft Access user interface or through DAO in code.

You can read more about it at the link below. There are examples although I didn't see where they specifically show using the DefaultValue property. http://technet.microsoft.com/en-us/library/cc966376.aspx

Per Access 97/Jet 3.5 SQL documentation no mention of the DEFAULT clause is made when describing the ALTER Table or CREATE Table statements. It is described as a new feature of Jet 4.0 here: http://support.microsoft.com/kb/275561

The only way that I know for sure is to set a default value is to open up the table design in the gui and then under field properties enter a default value. Do you have access to an installation of Access 97?

Though, I'm also guessing that with VB/VBA you can probably access the default value property for the field and set or modify - just not using sql.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!