[AccessD] Broken References in Runtime AXP

Gustav Brock gustav at cactus.dk
Thu Jul 17 13:21:33 CDT 2003


Hi Charlotte

Interesting and scaring.
Does this mean that the old A97 bug is still alive two versions later??

Would you mind testing the function below to verify if this is still
so? 

<code>

Public Function IsBroken97(ByVal ref As Access.Reference) As Boolean

' Alternative method to check if a reference is broken
' as the IsBroken property cannot be used in Access97.
'
' 2000-03-19. Gustav Brock. Cactus Data ApS.

' Refer to this article at Microsoft Technet:
'
' Article ID: Q186720
'
' The information in this article applies to:
' Microsoft Access 97
'
' SYMPTOMS
' In Microsoft Access, IsBroken is a property of the References collection.
' The Microsoft Access Help topic on the Isbroken property states the following:
'
' The IsBroken property returns a Boolean value indicating whether a
' Reference object points to a valid reference in the Windows Registry.
'
' Although this statement is correct, to receive this Boolean value
' you must trap for errors that are generated by the broken reference.
' Also, the IsBroken property becomes True only when the file being referenced
' is deleted and the Microsoft Windows Recycle Bin is emptied.
' This article details the steps necessary to receive the Boolean value.

  Dim booRefOK As Boolean
  On Error GoTo Err_IsBroken97
  
  If Len(Dir(ref.FullPath, vbNormal)) > 0 Then
    booRefOK = Not ref.IsBroken
  End If

Exit_IsBroken97:
  IsBroken97 = Not booRefOK
  Exit Function

Err_IsBroken97:
  ' Ignore non existing servers, drives, and paths.
  Resume Exit_IsBroken97
  
End Function

</code>

/gustav


> Yes, but I've tracked down the problem ... Or at least one of them.  I
> had taken it on faith that the BrokenReference method would actually
> return a -1 when a reference to another database was missing and that
> the IsBroken property of the reference object would return a -1 in that
> case as well.  Apparently, even fully disambiguated, that isn't true.
> Now I need to figure out how to NOT run it every time the application
> starts!  I had to resort to writing directly to a text file to figure
> out where it was going haywire. 



More information about the AccessD mailing list