Microsoft KB Archive/108714

From BetaArchive Wiki

FIX: "SQL Column Not Found" Error Causes Transgressed Handle

ID: Q108714



The information in this article applies to:

  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b
  • Microsoft FoxPro for MS-DOS, version 2.5




SYMPTOMS

In FoxPro 2.5, 2.5a, and 2.5b for Windows and FoxPro 2.5 for MS-DOS, if you have a calculated field in a BROWSE that calls a user-defined function (UDF), and the UDF performs an SQL SELECT command with a nonexistent column name, you correctly get the "SQL Column Not Found" error. If you choose the Cancel button, the program closes, but if you choose the Ignore button, you get dumped out of the program with a "Use of transgressed handle" error message in FoxPro for MS-DOS or a general protection (GP) fault in FoxPro 2.5 for Windows. In FoxPro 2.5a and 2.5b for Windows, the program enters a continuous loop until you select another option.


STATUS

Microsoft has confirmed this to be a problem in FoxPro versions 2.5, 2.5a, and 2.5b for Windows and FoxPro 2.5 for MS-DOS. This problem was corrected in FoxPro 2.5a for MS-DOS and in FoxPro 2.6 for Windows.

In FoxPro versions 2.5a and later for MS-DOS, you will be able to continue the program when you choose the Ignore button.


MORE INFORMATION

Steps to Reproduce Problem

The following program demonstrates the problem:

   *Test.prg
   USE (SYS(2004)+"FoxHelp") AGAIN
   BROWSE FIELDS Topic, Details, Class,;
                 KaBoom=KaBoom(ALIAS())
   RETURN  && won't get this far

   FUNCTION KaBoom
   PARAMETERS lcTopic
   * Column BogusCol does not exist.
   SELECT BogusCol FROM FoxHelp INTO ARRAY aTemp;
      WHERE Topic = m.lcTopic
   *RETURN IIF(_TALLY==0, "", aTemp[1])  && FoxPro has an
   * "insufficient memory" error if using this line - after
   * "not defined" error
   RETURN IIF(_TALLY==0, "", "something")  && FoxPro will GPF on this line
   ** end 

Additional query words: FoxDos FoxWin buglist2.50 buglist2.50a buglist2.50b fixlist2.50a gpf transgressed handle errmsg err msg fixlist2.60

Keywords          : kberrmsg FxprgSql 
Version           : 2.50 2.50a 2.50b | 2.50
Platform          : MS-DOS WINDOWS 
Issue type        : 

Last Reviewed: August 24, 1999
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.