access数据库问题:如何在程序中设置和修改某一字段的默认值呢?

解决方案 »

  1.   

    下面是ms sql server2000中ALTER COLUMN的说明
    ALTER COLUMNSpecifies that the given column is to be changed or altered. ALTER COLUMN is not allowed if the compatibility level is 65 or earlier. For more information, see sp_dbcmptlevel. The altered column cannot be: A column with a text, image, ntext, or timestamp data type.
    The ROWGUIDCOL for the table.
    A computed column or used in a computed column.
    A replicated column.
    Used in an index, unless the column is a varchar, nvarchar, or varbinary data type, the data type is not changed, and the new size is equal to or larger than the old size.
    Used in statistics generated by the CREATE STATISTICS statement. First remove the statistics using the DROP STATISTICS statement. Statistics automatically generated by the query optimizer are automatically dropped by ALTER COLUMN.
    Used in a PRIMARY KEY or [FOREIGN KEY] REFERENCES constraint.
    Used in a CHECK or UNIQUE constraint, except that altering the length of a variable-length column used in a CHECK or UNIQUE constraint is allowed.
    Associated with a default, except that changing the length, precision, or scale of a column is allowed if the data type is not changed. 以上说的是ALTER COLUMN不能达到的功能,看到最后一条,你就知道你的想法是不能实现的好像不行