HOWTO: Distributing RDS Client with Visual Basic Setup Wizard

ID: Q176874


The information in this article applies to:


SUMMARY

This article describes the steps to distribute the Remote Data Service (RDS) client files with a Visual Basic 5.0 application. You need to have a thorough understanding of how RDS and Visual Basic work before you attempt to distribute your application. There are other RDS Microsoft Knowledge Base articles available that you can use to learn more about RDS before distributing your application.

In order to distribute an RDS client application using Visual Basic you will need to include the following files with your setup program:


   msadce.dll*   - installed to \Program Files\Common Files\system\msadc
   msadco.dll*   - installed to \Program Files\Common Files\system\msadc
   msador15.dll* - installed to \Program Files\Common Files\system\ado
   msdadc.dll*   - installed to \Program Files\Common Files\system\ole db
   msdaps.dll*   - installed to \Program Files\Common Files\system\ole db
   msdaer.dll*   - installed to \Program Files\Common Files\system\ole db
   msr2c.dll*    - installed to \system
   msadcer.dll   - installed to \Program Files\Common Files\system\msadc
   msadcor.dll   - installed to \Program Files\Common Files\system\msadc
   msader15.dll  - installed to \Program Files\Common Files\system\ado
   msdaerr.dll   - installed to \Program Files\Common Files\system\ole db
   msr2cenu.dll  - installed to \system
   msdatsrc.tlb  - installed to \system
   wininet.dll   - installed to \system 

   * indicates an ActiveX component that needs to be registered. 


There are two ways you could distribute these files using the Visual Basic Application Setup Wizard.


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 1.5 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:

    
       Private Sub Command1_Click()
       'DataControl
       MousePointer = vbArrowHourglass
       Dim dc As New RDS.DataControl
       dc.Connect = "dsn=pubs;uid=sa;pwd=;"
       dc.SQL = "select * from authors"
       dc.Server = "<LINK TYPE="GENERIC" VALUE="http://ServerXXXX"">http://ServerXXXX"</LINK>
       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",
       "<LINK TYPE="GENERIC" VALUE="http://ServerXXXX")">http://ServerXXXX")</LINK>
       Set rs = df.Query("dsn=pubs;uid=sa;pwd=;", "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. Start the Visual Basic 5.0 Application Setup Wizard.


  2. On step 1 select your project, select "Rebuild the Project," then click "Create Setup Program".


  3. On step 2 ignore the dependency information by clicking Next.


  4. On step 3 click Single directory.


  5. On step 4 select your target setup directory.


  6. On step 5 clear the reference to the Msadco.dll file; this will be added manually later.


  7. On step 6 you should have only the required Visual Basic system files and your actual project files listed.


  8. On step 7 click Save Template so you can edit the .swt file later. Next, click Cancel because you do not want to create the entire setup program just yet.


  9. Find the .swt file you just saved and open it using Notepad or any ASCII text editor. Go to the bottom of the section named [File Summary] and paste in the following entries for RDS files:

    File9="C:\Program Files\Common Files\SYSTEM\MSADC\msadco.dll",True, "C:\Program Files\Common Files\SYSTEM\MSADC",$(DLLSelfRegister),True

    File10="C:\Program Files\Common Files\System\MSADC\msadce.dll",True, "C:\Program Files\Common Files\SYSTEM\MSADC",$(DLLSelfRegister),True

    File11="C:\Program Files\Common Files\System\MSADC\msadcer.dll",True, "C:\Program Files\Common Files\System\MSADC",,True

    File12="C:\Program Files\Common Files\System\MSADC\msadcor.dll",True, "C:\Program Files\Common Files\System\MSADC",,True

    File13="C:\Program Files\Common Files\System\ADO\msador15.dll",True, "C:\Program Files\Common Files\System\ADO",$(DLLSelfRegister),True

    File14="C:\Program Files\Common Files\System\ADO\msader15.dll",True, "C:\Program Files\Common Files\System\ADO",,True

    File15="C:\Program Files\Common Files\System\OLE DB\msdadc.dll",True, "C:\Program Files\Common Files\System\OLE DB",$(DLLSelfRegister),True

    File16="C:\Program Files\Common Files\System\OLE DB\msdaps.dll",True, "C:\Program Files\Common Files\System\OLE DB",$(DLLSelfRegister),True

    File17="C:\Program Files\Common Files\System\OLE DB\msdaerr.dll",True, "C:\Program Files\Common Files\System\OLE DB",,True

    File18="C:\Program Files\Common Files\System\OLE DB\msdaer.dll",True, "C:\Program Files\Common Files\System\OLE DB",$(DLLSelfRegister),True

    File19="C:\WINNT\system32\msdatsrc.tlb",True,
    "$(WinSysPath)",$(TLBRegister),True

    File20="C:\WINNT\system32\MSR2CENU.DLL",True, "$(WinSysPath)",,True

    File21="C:\WINNT\system32\MSR2C.DLL",True, "$(WinSysPath)",$(DLLSelfRegister),True


  10. Remove the hard returns we put in for formatting this article so each FileXX= entry is on only one line. Now, adjust the numbers for each added FileXX= entry so they are ordered correctly from 1 to the total number of included files. Save the .swt file and you are ready to rebuild the project.


  11. Start the Visual Basic 5.0 Application Setup Wizard and select the .swt file as your project. Step through to the final step and click Finish to create the distribution files. You should now have all the needed RDS client files for distribution of your application.


  12. On a computer that has not ever had any RDS files installed, test the functionality of your example program by running the Setup.exe file that the Application Setup Wizard created. If it does not work correctly, review the steps in this article to make sure you followed them correctly, and refer to Step 1, item 7.



REFERENCES

This article is one of a series dealing with the redistribution of Microsoft Data Access Components (MDAC); ODBC, OLE DB, ADO, RDS, the MDAC Standalone, MDAC Redistribution and the Data Access SDK. The whitepaper "Redistributing Microsoft Data Access Components" presents a comprehensive overview of this subject, including referencing the content of this Knowledge Base article. This whitepaper is located at the following Web address:

http://www.microsoft.com/msdn/news/feature/datajul98/redistmdac.htm


(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Jon Fowler, Microsoft Corporation

Additional query words: kbdse


Keywords          : 
Version           : WINDOWS:1.5
Platform          : WINDOWS 
Issue type        : kbhowto 

Last Reviewed: January 29, 1999