Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

How to: Add Data to Records

Visual Studio 2005

You can add data to records after creating blank records or replace data in existing records. You can also edit each field in a record on a separate line by working with the table in edit mode. For more information, see How to: Add Records to Tables.

To add or replace data in records

  1. Open the table in a browse window.

    NoteTip

    To view each field on a separate line, on the View menu, click Edit.

  2. In the table, insert the cursor in the field of the record you want, and type the data appropriate for the field's data type.

For more information, see How to: View Records in Tables.

To store data in records programmatically

  • Choose one of the following:

    • If the blank record you added is the current record, follow the APPEND BLANK command with the REPLACE command and specify the record to replace values in.

      NoteTip

      By default, REPLACE replaces values in fields, including empty fields for the current record. When you use REPLACE, make sure the table is open, that the record exists, that you specify the field you want to store values in, and a value for each field that is appropriate for the field's data type.

    -OR-

    • Open the table, then use the EDIT or CHANGE commands to display the table in edit mode.

    -OR-

    • Use the SQL UPDATE command to update records in a table.

For more information, see REPLACE Command (Visual FoxPro), EDIT Command, CHANGE Command, and UPDATE - SQL Command.

NoteTip

When you use the REPLACE or the SQL UPDATE command in a multiple user application, you can edit data without locking the record until you want to commit changes by turning on record or table buffering. For more information, see Programming for Shared Access.

Adding Null Values to Records

You can type null values for fields in records.

NoteNote

To specify the text displayed for null values, use the SET NULLDISPLAY command. For more information, see SET NULLDISPLAY Command.

To store a null value in a field

  1. Open the table in a browse window.

  2. In the table, insert the cursor in the field of the record you want, and press CTRL+0 (zero).

To store a null value in a field programmatically

  • Include the NULL keyword with the command you use to add or replace data.

See Also

Community Additions

ADD
Show:
© 2015 Microsoft