PRB: Connectivity Kit Produces Error 252 with No Error Message

Last reviewed: April 30, 1996
Article ID: Q116272
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro Connectivity Kit, versions 2.5, 2.6
  • Microsoft FoxPro for MS-DOS, version 2.5

SYMPTOMS

When you are executing a DBExec() function with a SELECT statement that returns approximately 40 or more fields, an error of 252 is returned from the DBError() function with a null error message.

CAUSE

The error occurs because the Connectivity Kit is generating an Xbase command to create a cursor or table in FoxPro with a large number of fields, and the command that is generated is exceeding the maximum length of a compiled line in FoxPro (1024 bytes). The number of fields required to cause the error varies based on the length of the column names. In general, however, the error is likely to occur when 20 or more fields are included in the SQL Select command.

RESOLUTION

There are several ways to work around the problem:

  • Normalize the table into two or more tables to reduce the number of columns in each table.

    -or-

  • Break up the SELECT statement into two or more SELECT statements, and then combine the resulting tables.

    -or-

  • Create a stored procedure or view using the following SELECT statement:

          SELECT col1=long_column_name1,col2=long_column_name2, .....
    

    -or-

  • Use the sp_rename procedure to rename the columns so that they have shorter names.


Additional reference words: FoxDos FoxWin 2.50 2.50a 2.50b 2.60 CK 252
errmsg err
msg
ODBC
KBCategory: kbprg kberrmsg kbprb
KBSubcategory: FxtoolCk


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.