You are on page 1of 6

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 DAOs 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 Install Re D
ed gis i
ter r
ed e
c
t
o
r
y
DAO350.DLL DAO version 3.5 Shared Ye D
s A
O
DAO2535.TLB DAO version 2.5/3.5 Comp No D
Backward Compatible anion A
Type Library to O
DAO3
50.dll
MSJTER35.DLL Microsoft Jet (and Syste No S
DAO) error message m y
DLL s
t
e
m
3
2
MSJINT35.DLL Localized Microsoft Syste No S
Jet (and DAO) error m y
strings s
t
e
m
3
2
MSVCRT40.DLL C Runtime DLL Syste No S
m y
s
t
e
m
3
2

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 Insta Re D
lled gis ir
ter ec
ed to
r
y
MSJET35.DLL Microsoft Jet engine (version Syste Ye S
3.5) m s ys
te
m
3
2
MSRD2X35.DLL MDB files from Microsoft Com Ye S
Access 2.0, Visual Basic 3.0 or panio s ys
earlier n to te
MSJ m
ET35 3
.dll 2
MSJTER35.DLL Microsoft Jet (and DAO) error Syste No S
message DLL m ys
te
m
3
2
MSJINT35.DLL Localized Microsoft Jet (and Syste No S
DAO) error strings m ys
te
m
3
2
VBAJET32.DLL VBA-Microsoft Jet Expression Syste No S
ExpSrv.DLL service m ys
VBA Runtime Syste te
m m
3
2

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 Insta Reg Dire
lled ister ctor
ed y
MSREPL35.DLL Microsoft Jet Syste No Syst
Replication m em3
2
MSXBSE35.DLL Xbase formats Syste Yes Syst
m em3
2
MSPDOX35.DLL Paradox formats Syste Yes Syst
m em3
2
MSTEXT35.DLL Text files Syste Yes Syst
m em3
2
MSEXCL35.DLL Spreadsheet files Syste Yes Syst
m em3
2
MSLTUS35.DLL Lotus formats Syste Yes Syst
m em3
2
MSEXCH35.DLL Exchange formats Syste Yes Syst
m em3
2

ODBCDirect
Install the following files for supporting ODBCDirect functionality. DAO uses RDO to handle its
ODBCDirect functionality. For this reason you may recognize these files as the core RDO files.
File Description Installe Re D
d gis ir
ter ec
ed to
ry
MSRDO20.dll Remote Database Shared Ye S
Objects 2.0 s ys
te
m
3
2
RDOCURS.dll Batch Client Cursor Compani Ye S
Library on to s ys
MSRDO te
20.dll m
3
2
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.
1 DAO350.dll needs to have MSVCRT40.dll and other required files on the computer before it can
register.
2 MSRDO20.dll needs to have ODBC installed before it will register. Use the ODBC Installation
program to install ODBC.
3 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 youve 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.dlls 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 its companion file of RDOCURS.dll.

You might also like