Microsoft KB Archive/193875

= FIX: Cannot Force Update Using a DataCombo Bound to ADODC or DE =

Article ID: 193875

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft ActiveX Data Objects 2.5

-



This article was previously published under Q193875



SYMPTOMS
If a DataCombo box is bound to a ADODC or the Data Environment and you try to force an update on the field that you changed in the DataCombo, it will not Update the backend database.



RESOLUTION
There are some workarounds for this behavior that include adding this line of code:

Adodc1.Recordset.Move(0)

instead of the Adodc1.Recordset.Update.

The Adodc1.Recordset.Move(0) will update the backend as soon as you issue this command. Moving off of the record using the Adodc1.Recordset.MoveNext or physically moving off the record by clicking on the navigation buttons on the ADO Data Control (moving off of the record) will also force an update.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed with Visual Basic 6.0 SP3 and ADO 2.5.



Steps to Reproduce Behavior
 Create a Standard EXE project in Visual Basic. Form1 is created by default. Go to the Project/Components menu and check Microsoft DataGrid Control 6.0, Microsoft DataList Controls 6.0, and the Microsoft ADO Data Control 6.0. Drag the DataCombo, the DataGrid, and the ADO DataControl onto the form. Go to the Properties of the ADO Data Control. Bind the ADO Data Control to the authors table in the pubs database on SQL Server. Do this by clicking the ellipse and picking the DSN name that is pointing to the Pubs Database. Under the RecordSource tab, pick adCmdTable under CommandType and then pick the authors table in the combo box below. Also make sure to set the correct password in the authentication tab. In the DataCombo properties, set the DataSource and RowSource to ADODC1. Also, set the DataField, BoundColumn, and the ListField to au_lname.</li>  Drag a CommandButton onto the form and paste the following line of code in the Click event: Adodc1.Recordset.Update

</li> Run the Project.</li> Physically go to the DataCombo, click on the field, and make a change by typing in several letters or numbers.</li> Click on the CommandButton to force the update and note that the au_lname on the DataGrid does not reflect the changes.</li></ol>

Keywords: kbbug kbfix kbvbp600fix kbctrl kbmdacnosweep kbado250fix KB193875

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.