MDE needed references

S

stoppal

I have Access XP professional edition. I

've created a MDE with many reference to .dll and .ocx files. When I
put this MDE file on other computers I get errors b/c of the
references, how can I make sure all the references that are needed are
on the other computers and that my MDE knows they are there??

PLEASE HELP IT"S REALLY IMPORTANT!

thank you
 
S

stoppal

The reference wizard looks interesting but I don't know if it's the
best solution, maybe you can help.

I need to make the install as easy as possible for the people using the
MDE file. I basically need to create some sort of install file. Which
would install all the reference and then the mde file. Is this
possible? I was thinking a .bat file or something, but I'm not sure
what the best method would be. Maybe even Accessxp runtime, but I
don't know how.

I also don't really know how the reference wizard would play a part.
Your answer difinitely answered my question, but I should have been
more detailed.

Your feed back is most appreciated and I look forward to hearing back.

thank you
 
D

Douglas J. Steele

There are many products out there that will package DLLs and OCXs so that
they can be properly installed and registered on all target machines. You
might be able to get away with using a bat file to install the files (and
their prerequisites, where appropriate) in the appropriate location, and
using regsvr32.exe to register those that require registration. It's
certainly not a bullet-proof approach, though.

Including the runtime is a bit more involved. First, you must own the Office
XP Developer Edition in order to be able to legally redistribute the
runtime. (If you don't already have it, you may be out of luck: Microsoft
stopped selling it over two years ago, when Office 2003 was released) While
the ODE does include a Package and Deployment Wizard, most people are not
that satisfied with it. I've read many endorsements for the products from
http://www.sagekey.com
 
S

stoppal

I found a freeware installer program called "Advanced Installer". It
looks pretty good. I think I will try it, but the one thing I need to
do is change the reference file locations in my mdb/mbe file. Is this
possible?

I have a reference dll and ocx files in m MDB/MBE file that shows a
path that may not be on every machine. I am going to replace a copy
the nessary dll, OCX files in the same folder as the MDE file.

How can I change the reference file location?

thank you again
 
R

Rick Brandt

I found a freeware installer program called "Advanced Installer". It
looks pretty good. I think I will try it, but the one thing I need to
do is change the reference file locations in my mdb/mbe file. Is this
possible?

I have a reference dll and ocx files in m MDB/MBE file that shows a
path that may not be on every machine. I am going to replace a copy
the nessary dll, OCX files in the same folder as the MDE file.

How can I change the reference file location?

If the library is properly installed and registered the actual path of the
location on disk need not be the same.
 
S

stoppal

But I get problems with my MDE file. The MDB file works great on
different machine. But as soon as I convert it to MDE I start getting
"NAME?" where "=date() " is, and other weird things happening. If
I use the MDE file on my computer it works, just not on other
computers. But I can use the MDB on other computers without a problem.

Any ideas?

thanks
 
D

Douglas J. Steele

I found a freeware installer program called "Advanced Installer". It
looks pretty good. I think I will try it, but the one thing I need to
do is change the reference file locations in my mdb/mbe file. Is this
possible?

I have a reference dll and ocx files in m MDB/MBE file that shows a
path that may not be on every machine. I am going to replace a copy
the nessary dll, OCX files in the same folder as the MDE file.

How can I change the reference file location?

I wouldn't advise it. If you're determined, though, you'll have to move the
files on your development machine, to make sure that the references will
work if they're not in the standard location. This will mean likely mean
reinstalling each of the references on your machine.
 
R

Rick Brandt

But I get problems with my MDE file. The MDB file works great on
different machine. But as soon as I convert it to MDE I start getting
"NAME?" where "=date() " is, and other weird things happening. If
I use the MDE file on my computer it works, just not on other
computers. But I can use the MDB on other computers without a problem.

Any ideas?

Well personally I avoid distributing Access apps that need any references other
than the defaults to avoid the exact problem you have. Are you sure you can't
use late binding and eliminate the references?
 
S

stoppal

what is late binding?

I already programmed the enter MDB and it would be hard to convert it
to VB.

thanks
 
R

Rick Brandt

what is late binding?

I already programmed the enter MDB and it would be hard to convert it
to VB.

Late binding is a way to utilize external libraries without adding a hard
reference. In addition to solving your problem it also makes the code version
independent regarding the external library. If you google on the topic you will
find plenty of information.
 
S

stoppal

I've been reading about late binding, but don't see how it actually
works.

If I have reference to a DLL, e.g myfile.dll
then I set a reference to ... myfile.dll in early binding.

Late binding seems to be set at run time, but all the example I see are
for applications, not for my dll files.

For example, I would need to get a reference to myfile.dll, and
mycomponent.ocx, etc. etc.

I do not see how to do this.

Please provide assistence.

thank you
 
T

Tony Toews

But I get problems with my MDE file. The MDB file works great on
different machine. But as soon as I convert it to MDE I start getting
"NAME?" where "=date() " is, and other weird things happening. If
I use the MDE file on my computer it works, just not on other
computers. But I can use the MDB on other computers without a problem.

I'm with Rick. What are you using all those DLLs and OCXs for? Can
you use API calls to get rid of some of them?

How do you get rid of troublesome ActiveX Controls/references?
http://www.granite.ab.ca/access/referencetroubles.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
S

stoppal

I've decide just to release the mdb file rather than a MDE file. It's
to hard to get the MDE to work.

Does any one know why the MDB works and MDE does not? What I mean is,
why can the MDB find the references while th MDE can not. I would
think they work the same way.


thanks
 
R

Rick Brandt

I've decide just to release the mdb file rather than a MDE file. It's
to hard to get the MDE to work.

Does any one know why the MDB works and MDE does not? What I mean is,
why can the MDB find the references while th MDE can not. I would
think they work the same way.

Never heard of that. In my experience the MDE and MDB would react identically to
reference issues.
 
S

stoppal

That is what I thought, b/c an MDE is just a compiled version or and
MDB. But it does not work idential. The only thing I can think of is
maybe since the MDE is already compiled, it can not adjust for a
references in different locations, where an MDB may be can.

Anybody with some knowledge on the subject, please shed some light.

Thanks
 
T

Tony Toews

I've decide just to release the mdb file rather than a MDE file. It's
to hard to get the MDE to work.

Does any one know why the MDB works and MDE does not? What I mean is,
why can the MDB find the references while th MDE can not. I would
think they work the same way.

The difference is though that MDBs can continue to work until you hit
lines of code that use the DLLs which couldn't be found. Whereas an
MDE requires that all your references be intact and working before
it'll even start executing any code.

Well sorta.

Subject: INFO: How to guarantee that references will work in your
applications. http://www.trigeminal.com/usenet/usenet026.asp?1033

I also use some code which checks that all my references are intact,
cleans up a few if I've just converted the app from A97 to A2002 or
newer, and displays the troublesome references.

Subject: INFO: How to guarantee that references will work in your
applications. http://www.trigeminal.com/usenet/usenet026.asp?1033

Function tt_FixReferences() As Boolean

' This function can't reside in tt_utils.mdb/mde as it is used to fix
any reference problems
' Including when converting from A97 to A2000 and A2002.

Dim ref As Reference
Dim stMsg As String, intPosn As Integer, strRefPathName As String,
blnCompile As Boolean


On Error GoTo tagError
For Each ref In Access.References
If ref.IsBroken Then
VBA.MsgBox "Ref" & ref.Name & " is broken."
Else
' Debug.Print ref.Name & ", " & ref.FullPath
Select Case Access.SysCmd(acSysCmdAccessVer)
Case 9# ' Access 2000
If ref.Name = "VBIDE" Then
strRefPathName = ref.FullPath
References.Remove ref
VBA.MsgBox strRefPathName & " removed."
blnCompile = True
End If
Case 10# ' Access 2002
If ref.Name = "VBIDE" Or ref.Name = "OWC10" Then
strRefPathName = ref.FullPath
References.Remove ref
VBA.MsgBox strRefPathName & " removed."
blnCompile = True
End If
End Select
End If
Next ref
tt_FixReferences = True
If blnCompile = True Then
Call Access.SysCmd(504, 16483)
MsgBox "Compiled."
End If


tagExit:
Exit Function

tagError:
If Err = 48 Then ' ?????
If VBA.Len(VBA.Dir(ref.FullPath)) > 0 Then
References.AddFromGuid ref.Guid, ref.Major, ref.Minor
Resume Next
Else
stMsg = "Reference " & vbCrLf & "'" & ref.FullPath & "'" _
& vbCrLf & "couldn't be restored."
VBA.MsgBox stMsg, vbCritical + vbOKOnly, _
"Error restoring references."
tt_FixReferences = False
Resume tagExit
End If
Else
stMsg = "An unexpected error occurred." _
& vbCrLf & "Number: " & Err.Number _
& vbCrLf & "Description: " & Err.Description
VBA.MsgBox stMsg, vbCritical + vbOKOnly, _
"Error restoring references."
tt_FixReferences = False
Resume tagExit
End If
End Function

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
S

stoppal

THANK YOU!

Just to understand what your code does. loops checking for broken
references, if the reference name is VBIDE, or OWC10 it removed them.

Does this sound accurate? But what happens if you need VBIDE, or
OWC10? Not that I do, but I need all my references, and if they are
removed that is just as bad.

I will review your http://www.trigeminal.com/usenet/usenet026.asp?1033
page and read through it. I saw it the other day, and was very
interested, but got really busy today.

Also, how do you know if you need to add VBA.XXXXXXX or another prefix
to a line of code? I have a lot of code and rewriting to include a
prefix such as "VBA" would be very time consuming, maybe 3 weeks worth
of time. Is there a faster way? Sorry, if these questions are stupid,
but I've been at this for weeks and I'm just pounding my head.

thank you
 
D

Douglas J. Steele

Assuming you want to put it in front of, say, your Left, Format, Mid and the
like, use the Replace feature in the editor.

Change all Left( to VBA.Left(, all Format( to VBA.Format( and so on.
 
T

Tony Toews

Just to understand what your code does. loops checking for broken
references, if the reference name is VBIDE, or OWC10 it removed them.

Does this sound accurate?
Correct.

But what happens if you need VBIDE, or
OWC10? Not that I do, but I need all my references, and if they are
removed that is just as bad.

Then I don't remove them. However these are sometimes, (or maybe
always as I misremember the details, present when you convert from A97
to A2000.

But I only left that code in to illustrate how you'd clean up
references. Of course this would only work in an MDB.

The key for your problem is

If ref.IsBroken Then
VBA.MsgBox "Ref" & ref.Name & " is broken."

Now you will know exactly which reference(s) is/are causing you the
problems.
Also, how do you know if you need to add VBA.XXXXXXX or another prefix
to a line of code? I have a lot of code and rewriting to include a
prefix such as "VBA" would be very time consuming, maybe 3 weeks worth
of time. Is there a faster way?

After you've read the Trigeminal.com article you'd realize that you
only need to worry about "VBA." in the first module that your autoexec
routine calls. After this code is executed either

1) your references are fine so you can keep on going and you don't
need the VBA. in any other module
or
2) your references are broken in which case you're screwed anyhow.
Sorry, if these questions are stupid,
but I've been at this for weeks and I'm just pounding my head.

And no question is ever stupid.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top