Gaining Remote Access to Microsoft Access with RDO - Controls on the form
(Page 5 of 5 )
From the tool box click the MSRDC control (added in the previous step) and draw it out on the form. It will look very much like the DAO control except that it has the caption MSRDC1 as shown. Add three text boxes and take out the text property so that they look like blank text boxes in the design view as shown.

Right click the MSRDC control to bring up the Property page for this control. Click on the drop-down arrow for Data Source and you should be able to locate the DSN created earlier as shown. The RDO does not have a SQL designer of its own, and you need to script the SQL statement for data access. SQL statements scripted here should be supported on the remote database. For this example a simple query which returns all columns is shown here.

Now you may access the property window of this control as shown here. All the data related items are categorized in this view. This window shows the SQL statement, the access permissions, and so on.

Data binding to Textbox Control
The way you bind the fields (columns) to the text boxes is very similar to the DAO method that you may be used to. Right click on the text box to bring up its properties window. Here you need to tweak two of the properties. When you click on an empty area in the box next to DataSource in the Data category you should be able to see the MSRDC1. This the control source for the text box. The field (column) can be selected by clicking on an empty area corresponding to the DataField in the Data Category. From the drop-down menu, which contains all the columns returned by the select statement, pick the one that you need to retrieve. Similarly the other two text boxes are configured. The text-boxes as configured return the first name, last name and telephone number of the employees table in the remote database.

When you save and run the program you should be able to navigate through the result set as shown in this screen shot of the form.

Summary
When using an ODBC DSN, it is really very easy to retrieve the result sets (same as Recordsets) from a remote Microsoft Access database. It is also possible to modify records which are not covered in this tutorial. It should be emphasized that DAO and RDO technologies are only present for backward compatibility. Moving on to ADO is recommended. There are plenty of articles and white papers on Microsoft and other sites where several of these migration issues are discussed.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |