DBEngine 属性

       

可以使用 DBEngine 属性在 Visual Basic 中访问当前的 DBEngine 对象及其相关属性。

expression.DBEngine

expression   必需。返回“Applies To”列表中的一个对象的表达式。

说明

DBEngine 由 Microsoft Access 设置,且在所有视图中都是只读的。

Application 对象的 DBEngine 代表 Microsoft Jet 数据库引擎。DBEngine 对象是 Data Access Objects (DAO) 模型中的顶层对象,它包含并控制 Data Access Objects 结构中的所有对象。

示例

以下示例在消息框中显示 DBEngine 属性。

Private Sub Command1_Click()
    DisplayApplicationInfo Me
End Sub

Function DisplayApplicationInfo(obj As Object) As Integer
    Dim objApp As Object, intI As Integer, strProps As String
    On Error Resume Next
        ' Form Application property.
        Set objApp = obj.Application
        MsgBox "Application Visible property = " & objApp.Visible
        If objApp.UserControl = True Then
        For intI = 0 To objApp.DBEngine.Properties.Count - 1
            strProps = strProps & objApp.DBEngine.Properties(intI).Name & ", "
        Next intI
        End If
        MsgBox Left(strProps, Len(strProps) - 2) & ".", vbOK, "DBEngine Properties"
End Function