INFO: Techniques for Returning a Recordset via RDSID: Q183294
|
There are three 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.
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 1.1, 1.5 or RDS 2.0 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).
There are two types of ADO Recordsets that you see used in conjunction with
RDS. The ADODB recordset comes from Msado15.dll, and is part of the entire
ADO object hierarchy. However, when marshalling a recordset across the
wire, in order to provide a thin client, (minimal DLL's and memory
footprint), RDS converts that recordset into an ADOR recordset. ADOR (from
Msado15r.dll) comes without the rest of the ADO object model. For the
purposes of this discussion (as well as any code you write) ADOR.Recordset
and ADODB.Recordset are synonymous. You should reference ADOR.Recordset in
your client application and whether you use ADOR.Recordset or
ADODB.Recordset in your server-side custom business object is irrelevant.
However, if you use ADODB, you can use the Connection and Command objects
which offer functionality not available just opening a recordset "stand-
alone".
Dim dc As RDS.DataControl
Set dc = New RDS.DataControl
' ASP Set dc = CreateObject("rds.datacontrol")
dc.Connect = "DSN=RDSDemo;UID=admin;PWD=;"
dc.SQL = "SELECT * FROM Authors"
dc.Server = "http://<Server Name>"
dc.ExecuteOptions = adcExecAsync 'RDS 1.5 Client Only!
dc.Refresh
While dc.ReadyState = 2 ' RDS 1.5 Client Only!
DoEvents ' User has control during asynchronous query.
Wend
Dim ds
Dim df
dim rs
Set ds = CreateObject("RDS.DataSpace")
Set df = ds.CreateObject("RDSServer.DataFactory", _
"http://<Server Name>" )
Set rs = df.Query("DSN=RDSDemo;UID=admin;PWD=;", _
"SELECT * FROM Authors")
Dim ds
Dim bo
dim rs
Set ds = CreateObject("RDS.DataSpace")
Set bo = ds.CreateObject("VBCustBusObj.OBJ", _
"http://<Server Name>")
Set rs = bo.Test3_ReturnRS("DSN=RDSDemo;UID=admin;PWD=;", _
"SELECT * FROM Authors")
The code in the following Microsoft Knowledge Base article(s) were taken
from the RDSVB sample, which demonstrates using RDS within Visual Basic.
QNumber Title
---------------------------------------------------------------------
Q183609 FILE: Rdsvb.exe Demonstrates How to Use RDS with Visual Basic
Additional query words: kbdse kbcode kbcrossref
Keywords : kbRDS
Version : WINDOWS:1.5
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: January 30, 1999