Microsoft KB Archive/297839

= FIX: Checking TYPE of Combo Box Or Listbox Value When RowSource Missing May Crash Visual FoxPro =

Article ID: 297839

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q297839



SYMPTOMS
In Visual FoxPro version 5.0 and later, if the RowSource of a list box or combo box is a non-existent table and you check the TYPE of the Value property during the form's Init method, you may receive the following error message:

Fatal error: Exception code=C0000005

In Visual FoxPro version 5.0a, you may receive the following error message:

Internal Consistency error.



STATUS
This problem was corrected in Microsoft Visual FoxPro version 7.0 for Windows.



MORE INFORMATION
This behavior does not occur in Visual FoxPro version 3.0. An error occurs, and the form does not appear.

Steps to Reproduce Behavior
The following code creates and runs a form that demonstrates the problem. SET SAFETY OFF CLEAR ALL CLOSE DATABASES ALL

CREATE FORM testType NOWAIT ASELOBJ(laObj, 1) && Gives you the form containing the selected object.

loForm = laObj[1] loForm.AutoCenter = .T.

loForm.AddObject('lstValues','listbox') WITH loForm.lstValues .RowSourceType = 6 .RowSource = &quot;testTable.f1&quot; .Name = &quot;lstValues&quot; ENDWITH

loForm.WriteMethod('Init', [WAIT WINDOW TYPE(&quot;ThisForm.lstValues.Value&quot;)])

KEYBOARD 'Y' CLEAR && Answers &quot;Yes&quot; to Save dialog. RELEASE WINDOW 'Form Designer'

DO FORM testType

Keywords: kbbug kbfix KB297839

-

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

© Microsoft Corporation. All rights reserved.