如果不是 adp ,建议使用 dao 实现这些功能,因为在 mdb 中,dao 是最成熟和有效率的。
Public Function GetFieldName(TableDefName As String) As String
On Error GoTo Doerr
Dim tbf As DAO.TableDef
Dim fld As DAO.Field
Dim strReturn As String
Set tbf = DBEngine.Workspaces(0).Databases(0).TableDefs(TableDefName)
For Each fld In tbf.Fields
strReturn = strReturn & "," & fld.Name
Next
If strReturn <> "" Then GetFieldName = Right(strReturn, Len(strReturn) - 1)
Exit Function
Doerr:
MsgBox "发生错误,指定的表可能不存在"
End Function
[此贴子已经被作者于2003-3-29 20:20:48编辑过]
|