其实这些属性都可以用dao 取得,只是得一个一个的去试而已.
比如下面的程序就取得了字段的某些属性
(有些属性 dao 不支持,但 currentdb 支持,比如 captiion 属性,也就是字段的标题属性. currentdb 不等同于 dao 的 database)
Public Function GetFiled(TableName As String)
Dim fld As DAO.Field
Dim tbf As DAO.TableDef
Dim rec As DAO.Recordset
'Set tbf = CurrentDb.TableDefs()
Set rec = CurrentDb.OpenRecordset("select * from buffer")
For Each fld In CurrentDb.TableDefs("TableName").Fields
rec.AddNew
rec!Key = "test"
rec!sa = fld.Name
' rec!na = fld.FieldSize
rec!nb = fld.Attributes
rec!na = fld.Size
rec!ba = fld.Required
rec!bb = fld.AllowZeroLength
rec!sd = fld.CollatingOrder
rec!sc = fld.Properties("caption")
' rec!sb = fld.ForeignName
' Debug.Print fld.FieldSize
rec!nc = fld.Type
rec.Update
Next
End Function
[此贴子已经被作者于2003-4-18 17:36:25编辑过]
|