Solved

Building a startup.exe that enables DAO on user systems

Posted on 2002-03-20
10
228 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
  • 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
 
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now