• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 334
  • Last Modified:

determine the References used by an MDE

how can i determine the References used by an MDE?  maybe from the debug window?
thanks,
mac
0
MacRena
Asked:
MacRena
  • 5
  • 4
  • 4
  • +1
1 Solution
 
GreymanMSCCommented:
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.
0
 
GreymanMSCCommented:
Opps. An MD_E_!

Sorry, that will only work for an MDB.
0
 
SidFishesCommented:
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
GreymanMSCCommented:
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"))
 
0
 
GreymanMSCCommented:
Even better, look into SidFishes' suggestion.  I will.
0
 
stevbeCommented:
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
0
 
MacRenaAuthor Commented:
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
0
 
MacRenaAuthor Commented:
of course, i installed "C:\Program Files\OIS\wzRef.mda" as an AddIn before trying the above.
0
 
stevbeCommented:
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
0
 
MacRenaAuthor Commented:

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


0
 
stevbeCommented:
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
0
 
MacRenaAuthor Commented:
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?
0
 
MacRenaAuthor Commented:
even though VBE is explained in Access97 Help, do you think that Access97 doesn't support it?
0
 
stevbeCommented:
I *think* 97 supported VBE.
Try setting it to your current project to see if it does ...

Set vbRefs = VBE.VBProjects("MyProject").References

if that works then I think you need to use the Project Name rather than the full path to the mde. Typically this is the name of the file itself but originator may have chnaged it.

Steve
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 5
  • 4
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now