Microsoft KB Archive/116272

{| = PRB: Connectivity Kit Produces Error 252 with No Error Message =
 * width="100%"|

ID: Q116272

2.50 2.50a 2.50b 2.60 | 2.50

WINDOWS              | MS-DOS kbprb 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:  kbprb KBSubcategory: FxtoolCk Keywords         : kberrmsg FxtoolCk Version          : 2.50 2.50a 2.50b 2.60 | 2.50 Platform         : MS-DOS WINDOWS
 * }