HOWTO: Use the RDS DataFactory via Standard ADO Open Method
ID: Q183628
|
The information in this article applies to:
-
Remote Data Service for ADO versions 1.5, 2.1 SP2
SUMMARY
RDS (Remote Data Service for ADO), is tightly integrated with ActiveX Data
Objects (ADO), and is included in the Microsoft Data Access Components
(MDAC). MDAC can be downloaded from the following Web site:
http://www.microsoft.com/data
You do not need to use specific RDS code to get to the RDS DataFactory on
your HTTP server through conventional ADO code. The example below shows how
to access the RDS DataFactory using the ADO Open Method.
MORE INFORMATIONStep-by-Step Example
NOTE: The following assumes that MDAC has been installed.
- Start a Standard Visual Basic EXE project.
- From the Project menu, choose References, and select the Microsoft ActiveX Data Objects Library that corresponds to the version of MDAC you have installed. Under Project Components, select the Microsoft FlexGrid Control.
- Add a FlexGrid control and a Command button to the Visual Basic Form. Paste the following code into the Command button's click event:
NOTE: Change the ServerXX, Select statement and data source name (DSN) if needed. The DSN is a System DSN for Microsoft Access. Other system DSNs may be used instead, for example, a
system DSN for SQL Server. Note that this is a DSN on the server, not on the client.
Private Sub Command1_Click()
Dim rs As New ADODB.Recordset
rs.Open "Select * from Products", _
"Provider=MS Remote;Remote Server=http://ServerXX;DSN=Advworks"
While Not rs.EOF
MSFlexGrid1.AddItem rs(0) & vbTab & rs(1)
rs.MoveNext
Wend
End Sub
The preceding sample code uses the Advworks DSN that uses the Microsoft
Access driver to access the Advworks database that installs with the
MDAC components.
REFERENCES
For additional information, please see the following Web site:
http://www.microsoft.com/data/ado/rds/
For additional information, please click the article number below
to view the article in the Microsoft Knowledge Base:
Q184237 PRB: Unable to Open Registry Key DriverID Error with Advworks
Additional query words:
Keywords : kbADO150 kbADO200 kbADO210 kbRDS150 kbRDS200 kbRDS210 kbGrpVBDB kbGrpMDAC
Version : WINDOWS:1.5,2.1 SP2
Platform : WINDOWS
Issue type : kbhowto
|