CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Threaded View

  1. #1
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Evil Bound Control Problem

    Dear friends,
    I encountered a strange thing which I think is a special one for all database Gurus. Especially for you, David, since it is a bound control and maybe evil. (Don't tell me to read your article, because I did. )

    I have made and attached a small demo project which isolates the problem to the very tip, leaving very, very few lines of code to show what happens. It is a very simple addresslist based on an Access table. It only has 3 fields, Name, Country and EMail. It only contains 2 records either, because that's enough to show.

    Please run the little demo in the IDE. It's only few lines of code.
    It gives you a typical standard input form and buttons to navigate between records, plus Edit and Cancel (the other buttons have no code). The text fields are bound to an adodb.recordset.

    If you click "Edit" the input fields are unlocked and you can change the contents.
    Clicking "Cancel" will make the changes undone, using the rs.CancelUpdate method.
    Now you see, when clicking "Edit" a combo box with all countries appears.
    You can select a country, and it is transfered to the country textbox, like entered manually. No data binding with the combo.
    But when you click "Cancel" now, the old content will not reappear. The new text is already stored in the record and CancelUpdate will not bring the old value back. It will, however, if the country name was typed in with the keyboard.

    What happens here???????
    Attached Files Attached Files

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