Step 5: DataControl is made usable (RDS Tutorial)

See Also   

You are Here...

Discussion

The returned Recordset object is available for use. You can examine, navigate, or edit it as you would any other recordset. What you can do with the recordset depends on your environment. Microsoft Visual Basic and Visual C++ have visual controls that can use a Recordset directly, or indirectly with the aid of an enabling data control.

For example, if you are displaying a Web page in Microsoft® Internet Explorer, you might want to display the Recordset object data in a visual control. Visual controls on a Web page cannot access a Recordset object directly. However, they can access (that is, bind to) the Recordset object through an RDS.DataControl. The RDS.DataControl becomes usable by a visual control when its SourceRecordset property is set to the Recordset object.

(The visual control object must have its DATASRC parameter set to the RDS.DataControl, and its DATAFLD property set to a Recordset object field (column).)

In this tutorial, set the SourceRecordset property.

Sub RDSTutorial5()
Dim DS as New RDS.DataSpace
Dim RS as New ADODB.Recordset   'Optionally, ADOR.Recordset
Dim DC as New RDS.DataControl
Dim DF as Object
Set DF = DS.CreateObject("RDSServer.DataFactory", "http://yourServer")
Set RS = DF.Query ("DSN=pubs", "SELECT * FROM authors")
DC.SourceRecordset = RS         'Visual controls can now bind to DC.
...

Next   Step 6