The information in this article applies to:
SUMMARYThere are several techniques for returning data in a disconnected recordset using the Remote Data Service (RDS). There are two objects on the client, the RDS.DataControl and RDS.DataSpace, and one object on a server, RDSServer.DataFactory, which you can manipulate in different ways to generate a recordset, and to submit changes made to the data it contains. The correct method for your application depends upon the design and functionality you want. MORE INFORMATION
The Remote Data Service allows you to remote an ActiveX Data Objects (ADO)
Recordset across HTTP, HTTPS or DCOM to a client computer. If using the HTTP/HTTPS protocal it assumes that you have a server running either Internet Information Server 3.0 (or greater),
or Personal Web Server. In either case, you will have installed the RDS Server components on that server. The client computer requires the RDS components, and the client application can be written in any
language that supports COM and manipulation of COM Objects (C++, Java,
Visual Basic For Applications, VBScript, and so forth). Technique #1 - The DataControlYou can use the RDS.DataControl to retrieve a recordset from the RDS Server via the Refresh method. You could also assign an existing recordset to the SourceRecordset property.Within the Active Server Pages page (ASP) environment, you can bind graphical controls to the RDS.DataControl. Whether in ASP or any other development environment, you can easily use the RDS.DataControl programmatically to retrieve, sort, and filter data. Most of the properties and methods of the DataControl resemble a subset of the ADO Recordset (either ADOR or ADODB.) The RDS.DataControl also offers asynchronous processing that is currently not offered within ADO 1.5. With the release of ADO 2.0 asynchronous processing is available. The RDS.DataControl uses a business object on the server, provided by RDS, called the RDSServer.DataFactory. The DataFactory generates a recordset and also receives changes made to the data it contains. You cannot override (directly) the DataControl to use a different business object. The following code demonstrates this technique using Visual Basic for Applications: NOTE: Starting with RDS 2.0, the functionality of the RDS DataFactory may be enhanced by writing a custom handler object that implements a specific interface called IDataFactoryHandler. For more information, please see ADO Help for the topic "Handler Property (RDS)."
Technique #2 - Using the DataSpace with the Default Business ObjectYou may use the RDS.Dataspace object to invoke a business object on the server. If you provide the ProgID of the default business object (RDSServer.DataFactory), then you use the business object that RDS provides for you. This business object can provide a Recorsdet, but offers no conflict resolution (or any information) regarding a failure if the changes you post to the data are not accepted.The following code demonstrates this technique using VBA:
Technique #3 - Using the DataSpace to a Custom Business ObjectA business object is nothing more than an ActiveX DLL registered on the RDS Server (and perhaps on the client, if you are using DCOM as your protocol). The advantage of this technique is that you can implement conflict resolution, data validation or other functionality within your business object.There are three protocols you can use to marshall a recordset to the client, HTTP, HTTPS, and DCOM. When using a custom business object you must add a registry setting to the server where the business object is registered. In the following example the VBCustBusObj.OBJ would need to be added to the following registry key:
Consult the RDS Online documentation for details about registry settings that may be required for any custom business object.The following code demonstrates this technique using VBA:
Technique #4 - Using the MS Remote ProviderStarting with RDS 2.0, you can use the MS Remote provider along with standard ADO code to return an RDS recordset. The advantage is that you may use ADO code similar to the code you would use with any other provider; the only difference is the connection string. Although your code looks like ADO, it is actually using RDS. So, you must use clientside recordsets with the MS Remote provider.The connection string for the MS Remote provider must specify the following:
The following code demonstrates this technique using VBA:
REFERENCESYou can find the latest documentation on RDS at the following site: http://www.microsoft.com/data/ado/rdsYou can download the latest version of the Microsoft Data Access Components, including the Remote Data Services, from the following site: http://www.microsoft.com/data/download.htmPlease visit the Microsoft Universal Data Access Web site for more information: http://www.microsoft.com/dataThe code in the following Microsoft Knowledge Base article was taken from the RDSVB sample, which demonstrates using RDS within Visual Basic: Q183609 FILE: Rdsvb.exe Demonstrates How to Use RDS with Visual Basic Additional query words:
Keywords : kbDatabase kbRDS kbRDS200 kbGrpVBDB kbGrpMDAC kbDSupport kbRDS210SP2 |
Last Reviewed: November 4, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |