Building Result Sets with RDO

Connecting Using RDO

In this exercise, you will use Visual Basic and RDO to connect to a data source and return rows of data. A partial solution has been provided for you.

* To open the RDO Project

  1. Start Visual Basic 5.0 .
  2. From the New Project dialog, select the Existing tab.
  3. Locate WA\Practice\Ch07\Lab7RDO.vbp and click Open .
  4. When prompted to add the project to Visual SourceSafe, click No .
  5. From the Project menu, click References .

    Note that a reference has been made to the Microsoft Remote Data Object 2.0 library.

* To connect to an ODBC data source
  1. Open the code window for the cmdConnect_Click event.
  2. Add the following RDO connection code:
     Set cn = New rdoConnection With cn .Connect = "DSN=nwind" .EstablishConnection rdDriverNoPrompt, False End With 
* To fill the textboxes with data from the employees table
  1. From the object list box on the code window choose (General) .
  2. From the procedure list box on the code window choose FillTextBoxes .
  3. In this procedure, you will write the code to fill the text boxes as in the example below.
     txtFirstName.Text = rs!firstname txtLastname.Text = rs!lastname 
* To examine the code in the rest of the application
  1. Review the code in the cmdFirst , cmdPrevious , cmdNext and cmdLast click events.
  2. Save your work.
  3. Start and test the application.


Microsoft Windows Architecture Training
Microsoft Windows Architecture for Developers Training Kit
ISBN: B00007FY9D
EAN: N/A
Year: 1998
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net