Using RDO Databinding in Visual C++
To use RDO databinding in Visual C++, you need to add an RDO RemoteData Control and point to a data source and a record source (SQL query). You also need to add an RDO data-bound control, point it to an RDO RemoteData Control, and select the fields to bind to the RDO RemoteData Control's record source.
To use RDO databinding in Visual C++
-
Configure an ODBC data source, if you have not already done so.
-
Create an MFC Dialog application or MFC Formview application using the MFC AppWizard.
-
Add the Microsoft RemoteData Control (RDO RemoteData Control) to the dialog box; see Inserting the Control into a Visual C++ Application.
-
Point the RDO RemoteData Control to your ODBC data source.
-
Right-click on the control and select Properties from the shortcut menu.
-
Select the Control tab.
-
Set DataSource to your ODBC data source.
-
As needed, set the username and password for your ODBC data source. Leave blank if the data source does not require a username or password.
-
Enter an SQL query into the SQL property. The data-bound controls can bind to the results of this query.
-
Set any other RDO RemoteData Control properties as needed.
-
Add a data-bound control. For example, add the DBGrid Control and set the data source as follows.
-
Right-click on the DBGrid and select Properties from the shortcut menu.
-
Click on the All tab.
-
Set the DataSource property to the RDO RemoteData Control. Click on the drop-down combo box for the property and find the ID of the RDO RemoteData Control. The default ID name is IDC_REMOTEDATACTL1.
-
To run in test mode, use CTRL+T. You will be able to scroll through the data. Use the Esc key or close the dialog box to end test mode.
If you compile and run the program, you will be able to scroll through the data as well.
Back to Databinding with ActiveX Controls in Visual C++.