?
Solved

Building a startup.exe that enables DAO on user systems

Posted on 2002-03-20
10
Medium Priority
?
234 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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 400 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

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.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

765 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