HOWTO: Distribute ADO with the Application Setup Wizard

ID: Q184265


The information in this article applies to:


SUMMARY

Redistributing ADO/DB version 1.5 correctly and safely with the Visual Basic Application Setup Wizard is done by SHELLing out and running the MDACRDST.EXE.


MORE INFORMATION

This article assumes you have ADO 1.5 already installed on your machine. ADO 1.5 is included with the Microsoft Data Access Components (MDAC) version 1.5, the Internet Explorer 4.0 Client SDK, the OLE DB 1.5 SDK, Internet Information Server 4.0, and as a standalone executable from the following Web site:

http://www.microsoft.com/data

NOTE: If you installed MDAC 1.5 components using the Internet Explorer 4.0 Client SDK, you should upgrade first to the version available publicly off the Web. Numerous bug fixes were made to the MDAC components, as well as to the MDAC setup between the time that IE shipped and the MDAC 1.5c components were released on the Web.

The MDACRDST.EXE setup includes only the binaries necessary to redistribute the components; it doesn't include documentation. This file can then be called from Setup1.frm's QueryUnload method.

MDACRDST.EXE can be downloaded from the Web at the following location:
http://www.microsoft.com/data/download.htm

How ADO and the Application Setup Wizard Interact

Currently, it is not possible to correctly install ADO/DB components with the Visual Basic Setup Wizard for Visual Basic 5.0 applications. This is due to several limitations in both ADO/DB required components and the Visual Basic Setup Wizard described below:
The MDAC Setup may have to reboot the system, depending on what the user has loaded in memory when setup is started. Thus, the Shell command is used to spawn the MDAC setup. Using SHELL allows for Setup1 and Setup to exit properly and to clean up after themselves.

Distributing ADO with the Application Setup Wizard and Mdacrdst.exe

To redistribute your own ADO/DB-based project, complete each of the following steps: (You can safely ignore warnings about no dependency information for ADODB.)
  1. There are two MDAC redistribution files: Mdacrdst.exe, which includes the SQL Server driver and Mdacfull.exe, which also has the Oracle and Access drivers. Make sure to use the correct redistribution file needed for the application you are distributing. Download the exe file.1. Download the mdacrdst.exe.


  2. Make a copy of the ..VB\Setupkit\Setup1 folder.


  3. Open the Setup1.vbp file in the ..VB\Setupkit\Setup1 folder.


  4. Add the following code and comments to Setup1.frm's QueryUnload method:
    
          'Variable used to string path and EXE together.
          Dim progname As String
          'Global gstrDestDir As String      'dest dir for application files
          'gstrDestDir is defined earlier in frmsetup1.bas
          'Uncommenting the line below hides the file on the user's machine.
          'This may be desired if it will be left on the user's machine after
          'the install. Note, the application's Uninstall routine will remove
          'this file, though.
    
          SetAttr gstrDestDir & "mdacrdst.exe", vbHidden
    
          'All the calls below invoke MDAC Setup in a Quiet mode, meaning no
          'choices or options for the user to select or choose, "Setup.exe /Q".
    
          'The first two methods provide a minimum of a standard setup
          'background and thermometer bar window showing the progress of the
          'install. The first install methods are the most user-friendly.
    
          'When setup is called with "/Q0" it exits with a Message box
          'notifying the user it completed successfully. It also tells the
          'user if it is necessary to reboot the system to complete the
          'installation and gives the choice to reboot now or later.
    
          progname = gstrDestDir & "mdacrdst.exe /q /c:" & Chr(34) & _
                     "setup.exe /Q0" & Chr(34) & ""
    
          'Setup called with "/Q1" is the same as "/Q0" but exits without any
          'notification to the user that it installed successfully. It also
          'does not provide any notification that it is about to reboot the
          'system - if necessary.
    
          'progname = gstrDestDir & "mdacrdst.exe /q /c:" & Chr(34) & _
                      "setup.exe /Q1" & Chr(34) & ""
    
          'When called with "/QT", almost everything is hidden and almost zero
          'feedback is given to the user that an install is occurring or when
          'it is finished. This method is probably the least favorable.
    
          'progname = gstrDestDir & "mdacrdst.exe /q /c:" & Chr(34) & _
                      "setup.exe /QT" & Chr(34) & ""
    
          'Spawns the MDAC installation.
          Shell progname, vbNormalFocus
     


  5. Save the project and rebuild the Setup1.EXE.


  6. Start the Application Setup Wizard and point it toward the desired project.


  7. By default, in the "ActiveX Server Components" step, Msado15.dll is checked. Uncheck it. This is because msdacrdst.exe will install and register all the necessary components for ADO to run.


  8. In the File Summary step, add "file: mdacrdst.exe" if a "Floppy disk" or "Disk Directories" was the chosen method for distribution. If "Single Directory" method was chosen, it may be desirable not to add mdacrdst.exe. By not adding the file in "Single Directory" method, the mdacrdst.exe is run from the install directory and not copied to the application's install directory. This is useful for CD distributions or net installs where it is not desirable to have a copy of the mdacrdst.exe on the client machine.


  9. In the final step, save as a template, and then go ahead and generate the distribution.



Keywords          : kbADO kbMDAC kbVBp500 
Version           : WINDOWS:1.5,5.0
Platform          : WINDOWS 
Issue type        : kbhowto 

Last Reviewed: May 11, 1999