How To Distribute RDS Client with Visual Basic Setup Wizard (176874)



The information in this article applies to:

  • Remote Data Service for ADO 2.7
  • Remote Data Service for ADO 1.5
  • Remote Data Service for ADO 2.0
  • Remote Data Service for ADO 2.1 SP2
  • Remote Data Service for ADO 2.5
  • Remote Data Service for ADO 2.6

This article was previously published under Q176874

SUMMARY

This article describes the steps to distribute the Remote Data Service (RDS) client files with a Visual Basic 5.0 application.

Starting with Microsoft Data Access Components (MDAC) 2.0, RDS has been incorporated into the Microsoft ActiveX Data Objects. RDS is now known as A Web Data Access Feature of ActiveX Data Objects.

All of the Microsoft Data Access Components are contained in a single redistributable, MDAC_TYP.EXE.

To ensure that your RDS clients have the RDS components, you should redistribute the proper version of the MDAC.

You can download the latest version of MDAC at the following Microsoft Web site: Note that MDAC 1.5 is no longer available for download.

Once you've downloaded MDAC_TYP.EXE, you have two options for redistributing it:
  • Include MDAC_TYP.EXE in your setup program.

    For more information on distributing MDAC_TYP.EXE in your Setup program, please see the following article in the Microsoft Knowledge Base:

    184265 How To Distribute ADO with the Application Setup Wizard

  • Run the MDAC_TYP.EXE as a standalone program. Note that DCOM must be installed before MDAC is installed. While Windows 2000, Windows NT 4.0, and Windows 98 have DCOM built in, you should ensure that your Windows 95 clients have installed DCOM before installing MDAC. You can download the DCOM95 redistributable from the following site: Note that DCOM95 must be run as a standalone program. You cannot include it in your Setup program.

MORE INFORMATION

Step One

Build the Test Visual Basic application. Assume that you are building this application on a computer that already has the proper RDS client files installed.
  1. Start a new Standard EXE project. Form1 is created by default.
  2. From the Project menu, select References, and then select Microsoft Remote Data Services Library.
  3. Add two CommandButtons to Form1, named Command1, and Command2 by default.
  4. Paste the following code into the General Declarations section of Form1:

    Note You must change Username=<username> and PWD=<strong password> to the correct values before you run this code. Make sure that Username has the appropriate permissions to perform this operation on the database.
       Private Sub Command1_Click()
       'DataControl
       MousePointer = vbArrowHourglass
       Dim dc As New RDS.DataControl
       dc.Connect = "dsn=pubs;Username=<username>;PWD=<strong password>;"  'dsn should be a system dsn
       dc.SQL = "select * from authors"
       dc.Server = "http://ServerXXXX"
       dc.ExecuteOptions = adcExecAsync
       dc.Refresh
    
       While dc.ReadyState = 2
       DoEvents 'user has control during async query
       Wend
       MousePointer = vbDefault
       MsgBox dc.Recordset.Fields(0).Value
       End Sub
    
       Private Sub Command2_Click()
       'DataSpace, DataFactory
       MousePointer = vbArrowHourglass
       Dim ds As New RDS.DataSpace
       Dim df, rs
       Set df = ds.CreateObject("RDSServer.DataFactory",
       "http://ServerXXXX")
       Set rs = df.Query("dsn=pubs;Username=<username>;PWD=<strong password>;", "select * from authors")
       MsgBox rs.Fields(0).Value
       MousePointer = vbDefault
       End Sub
    					
  5. Change the Server, SQL, and Connect strings to match actual servers you will be testing against.
  6. Save the project.
  7. Run the project and test its functionality against your server to verify that it works. If it does not work at this time, do not continue to Step Two below until you have figured out what is wrong. The RDS documentation, Readme.txt, and other Microsoft Knowledge Base articles will help you debug RDS configuration problems.

Step Two

Build the distributable application using the Visual Basic Application Setup Wizard.
  1. Optionally, include MDAC_TYP.EXE in your Setup program. See the REFERENCES section of this article for more information.
  2. Whether you include MDAC_TYP.EXE in your Setup program or not, you do not need to include separate Remote Data components in your Setup program. So, when running the Application Setup Wizard, remove the reference to Microsoft Remote Data Services Library (msadco.dll). This file and all other RDS files are included in MDAC_TYP.EXE.
  3. On a computer that has never had any RDS files installed, test the functionality of your example program by running the Setup.exe file that the Application Setup Wizard created. Be sure that DCOM is installed prior to installing MDAC.

REFERENCES

For additional information about distributing MDAC_TYP.EXE in your Setup program, click the following article number to view the article in the Microsoft Knowledge Base:

184265 How To Distribute ADO with the Application Setup Wizard

For additional information about installing DCOM before installing MDAC, click the following article number to view the article in the Microsoft Knowledge Base:

191704 PRB: Unable to Load File to Register It During Setup


Modification Type:MinorLast Reviewed:3/14/2005
Keywords:kbDatabase kbhowto KB176874