BrokenReference 屬性

此頁沒有內(nèi)容條目
內(nèi)容

返回一個(gè) Boolean 值,表明當(dāng)前數(shù)據(jù)庫是否包含任何對(duì)數(shù)據(jù)庫或類型庫的損壞的引用。如果為 True,則有損壞的引用。只讀。

expression.BrokenReference

expression     必需。返回“應(yīng)用于”列表中的一個(gè)對(duì)象的表達(dá)式。

說明

若要試用特定引用的有效性,請(qǐng)使用 Reference 對(duì)象的 IsBroken 屬性。

示例

該示例檢查當(dāng)前數(shù)據(jù)庫中是否有任何已損壞的引用,并向用戶報(bào)告結(jié)果。

' Looping variable.

Dim refLoop As Reference

' Output variable.

Dim strReport As String

' Test whether there are broken references.

If Application.BrokenReference = True Then

    strReport = "The following references are broken:" & vbCr

    ' Test validity of each reference.

    For Each refLoop In Application.References

        If refLoop.IsBroken = True Then

            strReport = strReport & "    " & refLoop.Name & vbCr

        End If

    Next refLoop

Else

    strReport = "All references in the current database are valid."

End If

' Display results.

MsgBox strReport