Solved

Building a startup.exe that enables DAO on user systems

Posted on 2002-03-20
10
233 Views
Last Modified: 2012-05-05
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
Comment
Question by:NadyaA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 6884153
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
 
LVL 14

Expert Comment

by:mgrattan
ID: 6884173
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
 

Author Comment

by:NadyaA
ID: 6884426
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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 6

Expert Comment

by:devtha
ID: 6885759
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
 

Author Comment

by:NadyaA
ID: 6889994
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
 
LVL 14

Accepted Solution

by:
mgrattan earned 100 total points
ID: 6890183
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
 

Author Comment

by:NadyaA
ID: 6890235
It worked-- thanks!

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

Nadya
0
 
LVL 14

Expert Comment

by:mgrattan
ID: 6898501
You're welcome, glad to help.

Mike.
0
 
LVL 6

Expert Comment

by:devtha
ID: 6899437
I did say LATE BINDING in another post refering to this one. Glad, everything on track now.
0
 

Author Comment

by:NadyaA
ID: 6899767
thanks to you too, devtha
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question