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

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
0
NadyaA
Asked:
NadyaA
  • 4
  • 3
  • 2
  • +1
1 Solution
 
nico5038Commented:
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)

0
 
mgrattanCommented:
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
0
 
NadyaAAuthor Commented:
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.
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
devthaCommented:
Nadyaa MG solution is what I refered to in the other swtchboard q.
Your best bet is the MG sol. It is upto you.
0
 
NadyaAAuthor Commented:
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
0
 
mgrattanCommented:
Open your database while holding down the Shift key on your keyboard; this will prevent the switchboard from opening.  Next, go to Tools, Startup in the menu and change the Display Form/Page selection to (none).

Go to Modules and create a new module.  Copy and paste the code I gave you earlier into the module and save it.

Now, create a new macro and call it Autoexec.  In the first command line select RunCode.  Down at the bottom under the Function Name section, type the name of the function you want to run; in this case, it would be typed in like this:
DAOTest()

Modify the DAOTest function that I gave you earlier so it will open your switchboard form.  For example:

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

0
 
NadyaAAuthor Commented:
It worked-- thanks!

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

Nadya
0
 
mgrattanCommented:
You're welcome, glad to help.

Mike.
0
 
devthaCommented:
I did say LATE BINDING in another post refering to this one. Glad, everything on track now.
0
 
NadyaAAuthor Commented:
thanks to you too, devtha
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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