CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2000
    Location
    KSA
    Posts
    43

    Strange Problem with DataCombo and CancelUpdate

    Dear All,
    I have a table which has a field that needs to be picked from a DataCombo.
    The DataCombo is to be filled from another table. I did this using desgin-time
    properties of the ADO Data Control and the DataCombo, and it is working fine.

    I put a Cancel button on the form and I assigned it the following code:


    private Sub cmdCancel_Click()
    Adodc1.Recordset.CancelUpdate
    Adodc1.Recordset.Move 0
    End Sub




    If I made a change to the DataCombo, then I clicked Cancel, The change is undone
    and the old value is restored. Very nice.

    After that I Changed the application to use run-time binding, and using ADODB.Recordset
    instead of the ADO DataControl. I assigned the exact previous properties, the
    only change is the use of run-time binding instead of design time.

    Now the application functions very well, except for the Cancel Button, as it does not
    revert the changes back, but instead it commits the change to the database.

    However, if I have a TextBox bound to the same table, it will revert the changes back.
    This problem seems to occur only with the DataCombo.

    any help or suggestion is greately appreciated.

    Thanks in advance.
    Regards.

    Abdullah.


  2. #2
    Join Date
    Jun 2000
    Location
    KSA
    Posts
    43

    Re: Strange Problem with DataCombo and CancelUpdate

    up


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured