LAB: Connecting via RDS

Connecting to RDS can be simple or complex. In this lab you will make a simple connection to a Web server and execute the default RDSServer.DataFactory. Listing 15.4 is all the code you will need.

Code Listing 15.4. RDS Code
 1: Private Sub cmdDownloadAccountActivity_Click()
 2:    Dim DS As New RDS.DataSpace
 3:    Dim RS As ADODB.Recordset
 4:    Dim DC As New RDS.DataControl
 5:    Dim DF As Object
 6:    Set DF = DS.CreateObject("RDSServer.DataFactory", "http://localhost")
 7:    Set RS = DF.Query("DSN=SmallTownDSN", "Select * from AccountTransation  where
 AccountID='1'") 8: DC.SourceRecordset = RS 9: mshfgAccountBalances.Recordset = DC ...

Get Sams Teach Yourself Microsoft® Windows® DNA Programming in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.