# Re: 资料库栏位型态

Posted by 小吴 on March 14, 1998 at 22:48:55:

In Reply to: 资料库栏位型态 posted by EDWARD on March 13, 1998 at 21:03:50:

我建议你可以写个程序来处理这种状况，例如

Function GetFieldTypeDesctiption(TypeID As DataTypeEnum) As String
Dim s As String

Select Case TypeID
Case dbText: s = "文字"
Case dbBoolean: s = "是/否"
' 其它的型别请自己加
Case Else: s = "未知"
End Select

GetFieldTypeDescription = s
End Function

这样你原有的程式就可以写成：
Grid1.Text = GetFieldTypeDescription(DATABASEname.TableDefs().Fields(i).Type)

Follow Ups: