请教 ACCESS VBA中acCheckBox,在C# DAO中哪里找到?
在网上找到一段ACCESS VBA代码,可以将创建的YES/NO 字段显示为复选框,但是里面的acCheckBox我在C# DAO中找不到对应的引用方法,请问下面代码示例中Set prp = fld.CreateProperty("DisplayControl", dbInteger, acCheckBox)这句话应该怎么写?
我现在是这么写的:Property pt = myField.CreateProperty("DisplayControl", DAO.DataTypeEnum.dbInteger, ??);第三个参数不知道怎么赋值
VBA示例如下:
Sub AddDisplayControl()
'Requires reference to Microsoft DAO 3.6 Object Library
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim db As Database
Dim strSQL As String
Set db = CurrentDb
'Create a table ...
strSQL = "Create Table tblLTD (TheYesNoCheck YesNo, TheYesNoCombo YesNo)"
db.Execute strSQL
'It is now in the table collection, so ...
Set tdf = db.TableDefs("tblLTD")
'Change the way the YesNo fields display.
'A Checkbox
Set fld = tdf.Fields("TheYesNoCheck")
Set prp = fld.CreateProperty("DisplayControl", dbInteger, acCheckBox)
fld.Properties.Append prp
'A combobox
Set fld = tdf.Fields("TheYesNoCombo")
Set prp = fld.CreateProperty("DisplayControl", dbInteger, acComboBox)
fld.Properties.Append prp
'We will need a format
Set prp = fld.CreateProperty("Format", dbText, "Yes/No")
fld.Properties.Append prp
End Sub