Microsoft KB Archive/193398

= BUG: Table Designer-Record Length Wrong if Field(s) Allow Nulls =

Article ID: 193398

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 Q193398



SYMPTOMS
If you have a table that contains a field or fields, which allow NULL values, when you view the Statistics in the Table Designer's Table page, the record length is under reported by 1 byte.



RESOLUTION
Use the RECSIZE function to find the correct record length.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.



Steps to Reproduce Behavior
  Run the following code from a program (.prg) file: CREATE TABLE Testtab (F1 C(10) NULL, F2 N(10) NULL, F3 L)     LIST STRUCTURE ?RECSIZE MODIFY STRUCTURE  Select the Table tab in Table Designer. The Length value in the Table Designer is 22, while the RECSIZE function returns 23.

If there are no fields that allow NULL values, the two numbers agree. If there are any fields that allow NULL values, the Length listed in the Table Designer is 1 less than the correct value.

The record length is the sum of all the field lengths plus 1 byte for the delete mark and 1 byte for the NULL field information, if any fields allow NULL values.

