You are on page 1of 5

DAO Installation

This document describes the steps required to create a setup program that
successfully installs DAO and its related files. It is recommended that you use
InstallShield Express which ships with VC++ 5.0 with the information in this document
to create your setup.

Proper setup of DAO is very important. Because DAO is a shared component that
only exists in one location on a machine, all applications using DAO may stop working
if DAO setup is not done correctly.
Introduction
To distribute an application that uses DAO, you must install the redistributable portions of DAO.
Depending whether your application uses the Microsoft Jet Engine or ODBCDirect workspaces, you must
also install either the redistributable portions of the Microsoft Jet Database Engine, or the redistributable
portions of the Remote Database Objects (RDO) or both.
DAO, Microsoft Jet, and RDO require a more complex installation procedure than simply copying files into
a directory. An application cannot have its own “private” copy of an OLE Automation server (such as
DAO) in an application directory. The server is registered by OLE, and all users use the same DLL.

Files
DAO and DAO’s ODBCDirect each require a core set of files. Microsoft Jet also has a core and a second
optional set that provides the ability to access other data formats.
Whether your application uses ODBCDirect or the Microsoft Jet Engine to access data determines if you
will install the Microsoft Jet Engine or ODBCDirect files.
Only the files described in this section can be distributed with your application to other users. You
cannot distribute other files, such as .hlp files or DAO header (.h) files.
Note: The DAO directory and System32 directory are explained in section 3.2.

DAO
DAO is comprised of the following core files. These files must be installed for DAO to function.
File Description Installed Registered Directory
DAO350.DLL DAO version 3.5 Shared Yes DAO
DAO2535.TLB DAO version 2.5/3.5 Backward Companion to No DAO
Compatible Type Library DAO350.dll
MSJTER35.DLL Microsoft Jet (and DAO) error System No System32
message DLL
MSJINT35.DLL Localized Microsoft Jet (and System No System32
DAO) error strings
MSVCRT40.DLL C Runtime DLL System No System32

Microsoft Jet Engine


Core Jet files
Microsoft Jet is comprised of the following core files. These files are sufficient to access version 3.0 .MDB
databases and ODBC data sources (in conjunction with an installed ODBC driver) when installed with
DAO.
File Description Installed Registered Directory
MSJET35.DLL Microsoft Jet engine (version 3.5) System Yes System32
MSRD2X35.DLL MDB files from Microsoft Access 2.0, Companion to Yes System32
Visual Basic 3.0 or earlier MSJET35.dll
MSJTER35.DLL Microsoft Jet (and DAO) error message System No System32
DLL
MSJINT35.DLL Localized Microsoft Jet (and DAO) error System No System32
strings
VBAJET32.DLL VBA-Microsoft Jet Expression service System No System32
ExpSrv.DLL VBA Runtime System
Optional files
The following optional files provide access to other data formats. Install the DLLs that correspond to the
file format you need to support, or if you need replication support.
Module Description Installed Registered Directory
MSREPL35.DLL Microsoft Jet Replication System No System32
MSXBSE35.DLL Xbase formats System Yes System32
MSPDOX35.DLL Paradox formats System Yes System32
MSTEXT35.DLL Text files System Yes System32
MSEXCL35.DLL Spreadsheet files System Yes System32
MSLTUS35.DLL Lotus formats System Yes System32
MSEXCH35.DLL Exchange formats System Yes System32

ODBCDirect
Install the following files for supporting ODBCDirect functionality. DAO uses RDO to handle it’s
ODBCDirect functionality. For this reason you may recognize these files as the core RDO files.
File Description Installed Registered Directory
MSRDO20.dll Remote Database Objects 2.0 Shared Yes System32
RDOCURS.dll Batch Client Cursor Library Companion to Yes System32
MSRDO20.dll

Installation
The following sections provide information on using the installation procedure.

Check if files are in use


The first step in the installation procedure is to see if programs that are using any files you may be
installing are running. If they are you may need to abort the installation and request the user to close other
applications before installing DAO.

Copy Files
Copy all files listed as DAO files (except the DAO350.dll and DAO2535.tlb) and all Microsoft Jet Engine
core files (and application specific optional files) or ODBCDirect files (depending upon the needs of your
application) to the system (system32 for NT) directory (referred to in the above charts as the System32
directory). Per usual DLL standards, you need to copy with version checking to make sure a newer
version of the file is not overwritten by your installation. All the DAO files contain appropriate version
resources.
Use the following procedure to copy DAO350.DLL and DAO2535.tlb:
1. For Windows NT (earlier version than 4.0), the DAO files always go into <windows>\MSAPPS\DAO.
For example, c:\winnt35\msapps\DAO.
For Windows 95 or Windows NT 4.0, the DAO directory is approximately c:\Program
Files\Common Files\Microsoft Shared\DAO. The exact location varies if the user has a
non-English version of Windows 95, which requires that the location be read from the registry. Locate
the following node in the registry:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
and retrieve the value of the key named CommonFilesDir.
2. If this registry key does not exist, then create it and set the value to:
\Program Files\Common Files
(making sure to use the correct driver letter).
3. After you have the value of the key, which will typically be: c:\Program Files\Common Files,
then append “\Microsoft Shared\DAO” and use that as the destination location for the dao350.dll and
dao2535.tlb.
4. Copy dao350.dll and dao2535.tlb to this directory using version checking. This is the Directory
referred to in the above charts as the DAO directory.

Register DLLs
After all the DLLs have been copied, they need to be registered. This is done by calling the
DLLRegisterServer entry point on each DLL if it exists. Note that because DAO requires Microsoft Jet
before it can successfully register , the order of copying files given previously is important.
Your setup program should use regsvr32.exe or an equivalent call to execute the DLLRegisterServer within
the following dlls (if they have been installed by step 3.2): DAO350.dll, MSJET35.dll, MSRD2X35.dll,
MSEXCL35.dll, MSPDOX35.dll, MSXBSE35.dll, MSLTUS35.dll, MSTEXT35.dll, MSEXCH35.dll,
MSRDO20.dll.
There are some special considerations you should keep in mind.
· DAO350.dll needs to have MSVCRT40.dll and other required files on the computer before it can register.
· MSRDO20.dll needs to have ODBC installed before it will register. Use the ODBC Installation program to
install ODBC.
· MSEXCH35.dll will need MAPI installed on your system before it can register.

Update File Reference Counts


Because DAO is shared by many programs, a count is kept of how many times the DLL has been installed.
This allows uninstall programs to remove the file only when no other program needs it. This is the same for
the MSRDO20.dll. The other files are never removed from the system.
5. Under the following location, search for a key with the same name as the file you’ve installed:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDlls\
6. If the key exists, increment its value by one (it is a dword). If the key does not exist you need to create a
key which is the name of the file (including path) of type dword and give it a value of 1. A typical entry would be:
\\Program Files\\Common Files\\Microsoft Shared\\DAO\\DAO350.DLL"=dword:00000001
(This example is in the export format used by regedit; you would only use single backslashes when creating
the key.)
Make sure you reference count both the MSRDO20.dll and the DAO350.dll.

Uninstall
To conform with Windows 95 guidelines, programs must be able to uninstall themselves and remove any
files and registry entries they create. Many setup toolkits, such as the provided InstallShield toolkit, provide
this as “built-in” functionality. It is beyond the scope of this document to provide all the details of Windows
95 installation requirements, but here are the basic steps required to uninstall DAO. Note that only the
shared components and their companion files will be removed the files installed system will never be
removed.
The DAO350.DLL and DAO2535.tlb will be removed only if the value of DAO350.dll’s reference count
key is 1. Otherwise the count is decremented and the file left in place.:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDlls\
"C:\Program Files\Common Files\Microsoft Shared\DAO\DAO350.DLL"
Before removing DAO350.DLL, you need to call its entry point DLLUnregisterServer so that it can remove
its entries from the registry. This can be done by using regsvr32.exe with the -u option.

The same rules apply for the MSRDO20.dll and it’s companion file of RDOCURS.dll.

You might also like