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++

  1. Configure an ODBC data source, if you have not already done so.

  2. Create an MFC Dialog application or MFC Formview application using the MFC AppWizard.

  3. Add the Microsoft RemoteData Control (RDO RemoteData Control) to the dialog box; see Inserting the Control into a Visual C++ Application.

  4. Point the RDO RemoteData Control to your ODBC data source.
    1. Right-click on the control and select Properties from the shortcut menu.

    2. Select the Control tab.

    3. Set DataSource to your ODBC data source.

    4. 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.

    5. Enter an SQL query into the SQL property. The data-bound controls can bind to the results of this query.
  5. Set any other RDO RemoteData Control properties as needed.

  6. Add a data-bound control. For example, add the DBGrid Control and set the data source as follows.
    1. Right-click on the DBGrid and select Properties from the shortcut menu.

    2. Click on the All tab.

    3. 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.
  7. 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++.