Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    References (Access 2000)

    Is there a place that would have listed the name, File, GUID, Major, and Minor for references found in the Access Reference list.
    Things such as DAO 3.6, ADO, Office 8, Office 9,...

    I am trying to create a routine that will verify that a certain reference is present and if it is not found then create it.



    Thanks
    Richard

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: References (Access 2000)

    If you're thinking of setting references in code, I've never had much luck with it in Access. If there is a missing reference, standard VBA instructions (that have nothing to do with the missing reference) will fail, so trying to check in code which references are missing probably won't succeed.

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: References (Access 2000)

    Well, you can use the code below to cycle thru the reference and report which ones are broken. Problem is, as Hans pointed out, if a critical reference is in fact missing, the code may not work. But here it is anyway.
    <pre>
    dim refItem as Reference

    For Each refItem In References
    If refItem.IsBroken = True Then
    strTitle = "MISSING Reference"
    strMessage = "MISSING REFERENCE!" & Chr(10) & Chr(13) _
    & "Location: " & refItem.FullPath & Chr(10) & Chr(13) _
    & "GUID: " & refItem.Guid & ", " & refItem.Major & ", " & refItem.Minor & Chr(10) & Chr(13)
    bytButtons = 16 'critical symbol
    Else
    strTitle = "Displaying References and Their Locations"
    strMessage = "Reference: " & refItem.Name & Chr(10) & Chr(13) _
    & "Location: " & refItem.FullPath & Chr(10) & Chr(13) _
    & "GUID: " & refItem.Guid & ", " & refItem.Major & ", " & refItem.Minor
    bytButtons = 64 'information symbol
    End If

    MsgBox prompt:=strMessage, Title:=strTitle, Buttons:=bytButtons

    Next refItem
    </pre>

    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: References (Access 2000)

    I built something like this for one of our applications, although we never put it into production. It is non-trivial and rather picky code to create and run.

    Many built in functions stop working and throw errors if you have a broken reference. In order for the code to run and fix the reference, even under a full installation of Access, the application must use completely disambiguated code in everything used in the reference testing function and in any routine called by that function. This means that all VBA methods used must be fully referenced as VBA.method in the code, while built-in Access objects and methods must be referenced as Access.object or Access.method and methods of the application object must be referenced as Access.Application.method. Standard constants will not be recognized in messagebox code, etc., so their numeric equivalent must be used. The code to repair the reference must run before any forms are opened or any other code is called to prevent the typical unfriendly error messages caused by a broken reference.

    If the function to test references is called from an AutoExec macro before loading the splash form or other code, the reference will be fixed and the compile errors will never occur, but under the runtime engine some built-in methods and properties don
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •