in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Is it possible to bind the combo to an ADO Recordset?

Last post 12-21-2007 3:50 PM by C1_GregL. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-18-2007 9:49 PM

    Is it possible to bind the combo to an ADO Recordset?

    Hello

     I would like to know if somehow an ADO Recordset can be the datasource for the Combo. Moreover, I would like that when a row is selected in the combo, that I could retrieve the corresponding ADO recordset bookmark.

    Thanks a lot.

  • 12-21-2007 3:50 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 431

    Re: Is it possible to bind the combo to an ADO Recordset?

    This can be done with a datatable in between.  You fill the datatable with the recordset and set that to the datasource.  Then you can use the SelectedValue from the C1Combo in the recordset.Find method to find the recordset bookmark.

    rs.Find("ProductID = '" & C1Combo1.SelectedValue & "'")
    [rs.Bookmark is set]

    This code would be placed in the SelectedValueChanged event, and C1Combo.ValueMember = "ProductID"

    Hope that helps,
    Greg L

    Filed under: ,
Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.