Results 1 to 13 of 13
  1. #1
    Join Date
    Nov 2003
    Posts
    55

    Unanswered: Linking References in for a MDE File

    Is there anyway to link References in a complied MS Access db? Like in Java or C I can import or link respectively. I have written a function to generate a report and keep getting reference/linking errors.

    Thanks,

    Animual

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Are you talking about Referencing to an MDE, setting up References, picking up the references set up in another db?
    All code ADO/ADOX unless otherwise specified.
    Mike.

  3. #3
    Join Date
    Nov 2003
    Posts
    55
    I'm talking about setting up references.

  4. #4
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    In your VBA Project Window: Tools -> References
    All code ADO/ADOX unless otherwise specified.
    Mike.

  5. #5
    Join Date
    Nov 2003
    Posts
    55
    I know how to do it through using the tools menu. I need to know if I can force the imports in code.

    For instance in java I wold have:

    import java.io.* before I instanciate my class

    Thanks,

    Tee

  6. #6
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Yeah, there's a References collection of a database you can read, and set. I have to go to lunch now, but if this is not answered by the time I come back, I will find my db that does this.
    All code ADO/ADOX unless otherwise specified.
    Mike.

  7. #7
    Join Date
    Nov 2003
    Posts
    55
    Thanks for the help.

    Animaul

  8. #8
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Here's how to get them:
    Dim i As Integer
    Dim appAccess As Access.Application
    Set appAccess = CreateObject("Access.Application")
    appAccess.OpenCurrentDatabase "C:\Del Me.mdb"
    Dim ref As Reference
    For Each ref In appAccess.References
    Debug.Print ref.Name & " - " & ref.FullPath
    Next ref

    The references collection also has an AddFromFile method that you can use when iterating through your targets.
    All code ADO/ADOX unless otherwise specified.
    Mike.

  9. #9
    Join Date
    Nov 2003
    Posts
    55
    I keep getting a runtime error 32813 when I use AddFromGuid.

    Have you experienced this problem before?

    Any suggestions?

    Thanks,
    Animaul

  10. #10
    Join Date
    Mar 2003
    Posts
    130
    I would use AddFromFile. If you use AddFromGUID you need to know
    the GUID of the reference like {D6D9A80A-6AA1-45DB-B2F0-004133918DD8}

    and I think those would be machine dependent.

  11. #11
    Join Date
    Nov 2003
    Posts
    55
    Thanks, you amke a good point.

  12. #12
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Globally Unique IDentifiers shouldn't be machine dependent. I suggest testing for a file's existence before using AddFromFile, but I would still use it over AddFromGUID. If you have a different version of ADOX, the file name will be different, although the name will still contain *msadox*.
    All code ADO/ADOX unless otherwise specified.
    Mike.

  13. #13
    Join Date
    Nov 2003
    Posts
    55
    Thanks, I wasn't sure if the Guid would change from system to system.

    Animaul

Posting Permissions

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