Microsoft KB Archive/179913

= PRB: Unexpected Behavior with FoxPro 2.x Database Using DBCombo =

Article ID: 179913

Article Last Modified on 1/8/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q179913



SYMPTOMS
When using the DBCombo control with a Foxpro 2.x type database the DBCombo may begin an infinite scroll upward.



RESOLUTION
To work around this problem, replaced the code in step 5 below with the following code: Dim myBookMark as String

Data1.Recordset.Index = "{Table Index Name}" Data1.Recordset.Seek "=", DBCombo1.Text

myBookMark = Data1.Recordset.Bookmark Data1.Refresh

Data1.Recordset.Bookmark = myBookMark DBCombo1.ReFill



STATUS
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
Before beginning, make sure that you have a Foxpro 2.x type table that has an existing index on the field that will be displayed in the DBCombo control.

 Begin a new Standard Exe VB Project. Under the Project -> Components menu option, add a reference to "Microsoft Data Bound List Controls." Add a new form to the project, and then add a Data Control and DBCombo control to the form.  Set the properties of the two controls to the following: Data Control: Connect          = FoxPro 2.6; DatabaseName     = {Path to the Foxpro Table} DefaultCursorType = 0 DefaultType      = 2-UseJet RecordSource     = {Table Name} RecordsetType    = 0-Table

DBCombo Control: BoundColumn      = {Field From Table} DataBindings     = Leave Blank DataField        = Leave Blank ListField        = {Field From Table} RowSource        = Data1 Style            = 0-dbcDropDownCombo   In the DBCombo_Change subroutine, place the following code: Data1.Recordset.Index = "{Table Index Name}" Data1.Recordset.Seek "=", DBCombo1.BoundText  Run the project, click the DBCombo box, and change the selection so that the code behind the change event is executed. The first time this combo box is clicked, it behaves normally. Click the DBCombo control again and try to scroll upward through the list by holding down the mouse button. The DBCombo will begin an endless scrolling loop that never reaches the top of the list.</ol>

NOTE: In the above code, the text inside the {} must be replaced with the appropriate information from the Foxpro table. This should be the name of the field to display in the DBCombo control and the name of the index that will be used to search on that field.

Additional query words: kbdse kbDSupport kbVBp kbVBp500 kbVBp600 KbNoKeyWord kbVFP200

Keywords: kbprb KB179913

-

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

© Microsoft Corporation. All rights reserved.