Microsoft KB Archive/130244

= PRB: All New Field Values Set to .NULL. When You Modify Table =

Article ID: 130244

Article Last Modified on 2/10/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q130244



SYMPTOMS
After executing the ALTER TABLE command to add a new field to a table or after modifying a table manually, all of the field values for a new field are set to .NULL. for each record in the table.



CAUSE
This behavior occurs if NULL is set ON by using the SET NULL command.



RESOLUTION
Issue the SET NULL OFF command before executing an ALTER TABLE command or before modifying a table manually when using the Database Container.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
  From the Command window, issue the following commands: SET NULL ON  CREATE DATABASE mydata CREATE TABLE mytable (cFld1 C(20)) APPEND BLANK REPLACE cFld1 WITH "Hello" BROWSE   Browse the table to view the first record, and note the table structure. Then modify the table with an ALTER TABLE command: ALTER TABLE mytable ADD COLUMN cNewfld C(20) BROWSE 

Now the field value for cNewfld holds the value .NULL..

NOTE: Placing NOT NULL at the end of the ALTER TABLE command doesn't work if SET NULL is ON. Instead, the error message "Field NEWFLD does not accept null values" is displayed, and the field is not added.

Additional query words: VFoxWin

Keywords: KB130244

-

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

© Microsoft Corporation. All rights reserved.