Microsoft KB Archive/166509

= BUG: Column Name Greater Than 128 Characters Cause Error =

Article ID: 166509

Article Last Modified on 12/3/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0b for Macintosh
 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q166509



SYMPTOMS
Changing a column's name to a value greater than 128 characters can cause the operating system to return a memory violation error while modifying the structure of the table. The error occurs after changing the column name of a table with the ALTER TABLE command. This command allows you to programmatically assign a column a name greater than 128 characters in length. The dialog boxes available through the interface, such as those invoked with the MODIFY STRUCTURE command, do not allow a name greater than 128 characters.

One of the following system error appears depending on the version of the operating system:

 In Windows 95, the following error appears:

This program has performed an illegal operation and will be shut down.

Clicking Details reveals the following message:

VFP caused an invalid page fault in module KERNEL32.DLL at.

 In Windows NT 4.0, the following error appears:

An application error has occurred and an application error log is being generated.

VFP.exe

Exception: access violation, Address:.

 Finally, the Macintosh operating system reports:

Sorry, a system error occurred.

"Microsoft Visual FoxPro"

error type 11



In each case that error may or may not be preceded by an "Internal consistency" error.

This error does not occur in Visual FoxPro 5.0 for Windows.



RESOLUTION
When using the ALTER TABLE command, do not create field names longer than 128 characters.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The Visual FoxPro Help file topic entitled "Visual FoxPro Naming Rules" states:

Use 1 to 254 characters, except for field names in free tables and index tags - they can be 10 characters at most.

However, the operating system shuts down Visual FoxPro 3.0 if you attempt modifications to a table containing a field name greater than 128 characters from within the Table Designer window.

Steps to Reproduce Behavior
 Use the Customer table located in the \Samples\Data folder.  Issue the following command in the Command window: COPY TO Home+"Ztest.dbf" CLOSE ALL CREATE DATABASE Ztest.dbc MODIFY DATA </li> Select Add Table from the Database menu.</li> From the Open dialog box double-click Ztest.dbf to add it to the database container.</li> Bring the Command window forward by pressing CTRL+F2.</li>  In the Command window, type the following command: ALTER TABLE Ztest RENAME COLUMN Title to Verylongname...longname Where Verylongname is a long string of letters greater than 128 characters in length. </li> Click on the Ztest table window in the database container window, then select Modify from the Database menu.</li> Click at several locations and type in the comments Editbox of the Table Designer window, then navigate between tabs, and click OK to close the window. At this point or earlier the error occurs.</li></ol>

Additional query words: kbvfp500 kbvfp600

Keywords: kbbug KB166509

-

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

© Microsoft Corporation. All rights reserved.