Link to home
Start Free TrialLog in
Avatar of NadyaA
NadyaA

asked on

Building a startup.exe that enables DAO on user systems

Hi everybody,

I have a database that resides in a .mdb and .mdw file, that requires the Microsoft DAO 3.6 Object Library to run properly.  I enabled this on my computer, but the problem is that the database will be going out to a number of users I have no contact with.  I need to create a startup.exe package that will enable the library so that the database runs properly on all the computers where it's installed.  I've been told that this is possible with Office 2000 developer, which I do have.  Can anybody guide me through the process?

Thanks,

Nadya
Avatar of nico5038
nico5038
Flag of Netherlands image

Hi nadya,

Just "install" in developer the add-in for creation of a package. (Can be done permanently or "on request".

Then start the wizard and that will be just a click-execersize. You'll notice that all related libraries are traced and showed enabling you to add additional (e.g. text-files) if you want.

Need more?

Nic;o)

Avatar of mgrattan
mgrattan

You can do this in Access using a couple of simple functions.  Here's the function you would use (call it from an Autoexec macro before opening any forms or running any other code):

Function DAOTest()
If Not VerifyReference("DAO") Then
    ReferenceFromFile("C:\Program Files\Common Files\Microsoft Shared\DAO\dao36.dll")
End If
End Function

Here are the functions you need in addition to the first one:

Function VerifyReference(RefName As String) As Boolean
Dim ref As Reference
Dim i As Integer

For i = 1 To Application.References.Count
    If References.Item(i).Name = RefName Then
        VerifyReference = True
        Exit Function
    End If
Next i
VerifyReference = False

End Function

Function ReferenceFromFile(strFileName As String) As Boolean
    Dim ref As Reference

    On Error GoTo Error_ReferenceFromFile
    Set ref = References.AddFromFile(strFileName)
    ReferenceFromFile = True

Exit_ReferenceFromFile:
    Exit Function

Error_ReferenceFromFile:
    MsgBox Err & ": " & Err.Description
    ReferenceFromFile = False
    Resume Exit_ReferenceFromFile
End Function
Avatar of NadyaA

ASKER

Nico--  I installed the Office 2000 Developer tools to my system; I'm trying to install the add-ins, but I keep getting this error message:

"There was an error copying the add-in to the Microsoft Access directory.  The add-in was not added to the Microsoft Access directory."

I was able to install the Import/Export wizards, and the Microsoft Access Utilities, but neither of these seem right.  Ideas?

I'll be out of the office tommorow, but I'd appreciate any tips for Friday.

mgrattan-- I'm going to try Nico's solution first, I may come back to yours on Friday.
Nadyaa MG solution is what I refered to in the other swtchboard q.
Your best bet is the MG sol. It is upto you.
Avatar of NadyaA

ASKER

Hi there folks,

Well, I haven't been able to work out Nico's solution, so I'm moving onto mgrattan's.  But I haven't used macros before, so I'm not sure how to call it before everything else.  At the moment my database is set to open a switchboard form automatically on startup.  

So where should I put this code?  How do I set it up to be called right away, and then to call the switchboard?

Thanks,

Nadya
ASKER CERTIFIED SOLUTION
Avatar of mgrattan
mgrattan

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
Avatar of NadyaA

ASKER

It worked-- thanks!

Thanks too to Nico and devtha for looking in on this question.

Nadya
You're welcome, glad to help.

Mike.
I did say LATE BINDING in another post refering to this one. Glad, everything on track now.
Avatar of NadyaA

ASKER

thanks to you too, devtha