The information in this article applies to:
- Remote Data Service for ADO version 1.5
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.
- Individually select each file when you are prompted for "Add Local" and
"Add Files" by the Setup Wizard.
-or-
- Include the file list we have provided below that you can insert into
the .swt file the Setup Wizard creates. The steps in the MORE
INFORMATION section will guide you through this process.
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.
- Start a new Standard EXE project. Form1 is created by default.
- From the Project menu, select References, and select Microsoft Remote
Data Services 1.5 Library.
- Add two CommandButtons to Form1, named Command1, and Command2 by
default.
- 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 = "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;uid=sa;pwd=;", "select * from authors")
MsgBox rs.Fields(0).Value
MousePointer = vbDefault
End Sub
- Change the Server, SQL, and Connect strings to match actual servers you
will be testing against.
- Save the project.
- 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.
- Start the Visual Basic 5.0 Application Setup Wizard.
- On step 1 select your project, select "Rebuild the Project," then click
"Create Setup Program".
- On step 2 ignore the dependency information by clicking Next.
- On step 3 click Single directory.
- On step 4 select your target setup directory.
- On step 5 clear the reference to Msadco.dll; this will be added manually
later.
- On step 6 you should have only the required Visual Basic system files
and your actual project files listed.
- 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.
- 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
- 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.
- 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.
- 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.
(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Jon
Fowler, Microsoft Corporation
Version : WINDOWS:1.5
Platform : WINDOWS
Issue type : kbhowto
|