Microsoft KB Archive/149771

= BUG: Rebind Fails if Retrieve Fields Are Set at Design Time =

Article ID: 149771

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 16-bit Enterprise Edition
 * Microsoft Visual Basic 4.0 32-Bit Enterprise Edition

-



This article was previously published under Q149771



SYMPTOMS
When you execute the Rebind method after changing the data on a Data control bound to a DBGrid control with fields retrieved by clicking the right-mouse button on the DBGrid control, clicking on Retrieve Fields clears the DBGrid control but does not display the changed data.



STATUS
Microsoft has confirmed this to be an issue in the Microsoft products listed at the beginning of this article. Microsoft is researching this issue and will post new information here in the Microsoft Knowledge Base as it becomes available.



WORKAROUND
Use a Recordset to retrieve Field names instead of using Retrieve Fields from the right-click pop-up menu.



Steps to Reproduce Behavior
 Start the 16-bit or 32-bit Visual Basic 4.0. If it is already running, on the File menu, click New Project.  Add a Data control and a DBGrid Control to the Form1 form. Set the properties of the following controls:   Control          Default Name        Property            Value --

Data Control    Data1               DatabaseName       BIBLIO.MDB RecordSource      Authors DBGrid          DBGrid1             DataSource         Data1  Right-click on the DBGrid control and click Retrieve Fields on the menu. The Column headers on the DBGrid control contain the names of the Fields.  Copy the following code to the Code window of the Form1 form: Option Explicit

Private Sub Form_Click 'Change the RecordSource to the Titles table Data1.RecordSource = "Titles" Data1.Refresh DBGrid1.Rebind End Sub  On the Run menu, click Start, or press F5. Click on the form and note that the DBGrid control is cleared of all data.</li></ol>

Additional query words: 4.00 vb4win vb4all DBGrid buglist4.00

Keywords: kbbug KB149771

-

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

© Microsoft Corporation. All rights reserved.