Link to home
Start Free TrialLog in
Avatar of MacRena
MacRenaFlag for United States of America

asked on

determine the References used by an MDE

how can i determine the References used by an MDE?  maybe from the debug window?
thanks,
mac
Avatar of GreymanMSC
GreymanMSC

Go to the Visual Basic Editor  (either open a code module, or through the toolbar: Macros>Visual Basic)

From the editor's toolbar select: Tools > References.  

A dialog should appear indicating which reference you have set at the top of the list, and most (but not all) of the available references in the system registry.  Simply check and uncheck the references in the list, or click the browse button to search for those that don't automatically appear.
Opps. An MD_E_!

Sorry, that will only work for an MDB.
Avatar of SidFishes
The best I can think right now is a bit of a kludge, sorry.

You can use a few macros utilising the RunCode action.

You can determine the number of references set by using:
 Action: RunCode
 Function Name:  MsgBox(References.Count)

You can then determine each particular reference by using:  MsgBox(References.Item(1).Name)
Note that the Item collection is base 1 indexed (so it runs from 1 to References.Count).

You can also determine is a particular index is broken by using: MsgBox(Iif(References.Item(2).IsBroken,"Broken","Okay"))
 
Even better, look into SidFishes' suggestion.  I will.
Why make things difficult, get the source code and open it in the full version to see what ther references are ot ask the person who created the mde what the Library requirements are.

Steve
Avatar of MacRena

ASKER

stevebe,
that answer gave me a chuckle.  getting the sourcecode isn't an option.  but thanks for the attempt.

Greyman,
i like the method, but "VBA" doesn't tell me enough.  very impressive attack, though.

Sid,
in order to follow these instructions:

>>copy or move the References Wizard to the MSAccess directory on your hard drive (if you install it as an Add-In as at 1 above then this should be done for you by the Add-In wizard), then call the wzRef_Test function from code as follows,...<<

won't i need to create a code page?  is there a way of doing that in a compiled .MDE???  i hope so, but i don't think so.  what am i missing?

just for fun, i downloaded the wzRef.mda to the folder of my app, then opened the Immediate Window and pasted in
Application.Run "References Wizard.wzRef_Test"
but the error said my program couldn't find the "Procedure".

tried also
Application.Run "C:\Program Files\OIS\wzRef.mda"
with the same "can't find Procedure" error.

thanks for all replies!
mac
Avatar of MacRena

ASKER

of course, i installed "C:\Program Files\OIS\wzRef.mda" as an AddIn before trying the above.
Requires reference to Microsoft Visual Basic for Applications Extensibility 5.3.

Open a non mde database, add the mde file as a reference.
Change "LIB" to the name of the mde as displayed in the references dialog.


Public Function GetRemoteMDERefs()

    Dim vbRefs As VBIDE.References
    Dim vbRef As VBIDE.Reference
   
    Set vbRefs = VBE.VBProjects("LIB").References
    For Each vbRef In vbRefs
        Debug.Print vbRef.FullPath
    Next
   
    Set vbRef = Nothing
    Set vbRefs = Nothing

End Function
Avatar of MacRena

ASKER


thanks, steveb, but it broke on "VBE."  in  Set vbRefs = VBE.VBProjects("O:\invdat\MSS\mssprg.mde").References
the error = "variable not defined."

i can't find where VBE would be defined.  this doesn't make sence.

http://support.microsoft.com/?kbid=292037  uses it (apparently) undefined

tried  Application.VBE.  and tried CurrentDb.VBE and both of those failed
the error = "method or data member not found"

(Microsoft Visual Basic for Applications Extensibility 5.3 is checked and moved up, but i don't think that's relevant to this problem)

any ideas what i'm doing wrong?

thanks,
mac


Did you add the mde you are interested in as a reference to your mdb that you are testing from?
Than just use the Project name of the mde.

Steve
Avatar of MacRena

ASKER

yes, sorry i didn't include that in my reply.

the References are (in order):
Visual Basic for Applications   (VBA322.DLL)
M$ Access 8.0 Object Library (MSACC8.OLB)
M$ VBA Extensibility Lib 5.3    (VBEEXT1.OLB)
MyProject                             (\\fs1\data\MyFolder\MyProject.mde)
M$ DAO 3.6                          (dao360.dll)
M$ Scripting Runtime             (scrrun.dll)
M$ Outlook 8.0                      (msoutl8.olb)

'*******************  begin code *******************
Public Function GetRemoteMDERefs()
    Dim vbRefs As VBIDE.References
    Dim vbRef As VBIDE.Reference
    Set vbRefs = VBE.VBProjects("O:\MyFolder\MyProject.mde").References                 '  <----  breaks here (it doesn't like VBE.)
'    Set vbRefs = VBE.VBProjects("\\fs1\data\MyFolder\MyProject.mde").References      ' <----  i also tried
    For Each vbRef In vbRefs
        Debug.Print vbRef.FullPath
    Next    
    Set vbRef = Nothing
    Set vbRefs = Nothing
End Function
'*******************  end code *******************

the compiler breaks on VBE.  saying the variable is not defined
so i THINK i'm doing all that you instructed, but the compiler won't run it.

does it work on your machine?
Avatar of MacRena

ASKER

even though VBE is explained in Access97 Help, do you think that Access97 doesn't support it?
ASKER CERTIFIED SOLUTION
Avatar of stevbe
stevbe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial