标题: 可否编程修改表中字段的属性设置 [打印本页] 作者: yangruilai 时间: 2002-12-8 05:09 标题: 可否编程修改表中字段的属性设置 可否编程修改表中字段的属性设置,如默认值等?作者: txman 时间: 2002-12-8 06:46
可以。用DAO,好像ADO也可以作者: yangruilai 时间: 2002-12-9 01:59
希望具体些!作者: cattjiu 时间: 2002-12-9 16:00
Private Sub AddField_Click()
Dim dbs As Database
Dim tdf As TableDef
Dim fld1 As Field, fld2 As Field, fld3 As Field, fld4 As Field, fld5 As Field, fld6 As Field, fld7 As Field
Set dbs = CurrentDb
Set tdf = dbs.TableDefs("runapp")
Set fld1 = tdf.CreateField("RunNo", dbText, 6)
Set fld2 = tdf.CreateField("DimCust", dbText, 6)
Set fld3 = tdf.CreateField("DimProd", dbText, 6)
Set fld4 = tdf.CreateField("DimCost", dbText, 6)
Set fld5 = tdf.CreateField("DimInter", dbText, 6)
Set fld6 = tdf.CreateField("Curr", dbText, 6)
Set fld7 = tdf.CreateField("Dim5", dbText, 6)