Edit

Purpose
Used to update the data associated with a specified record.

Syntax (Method)
object.Edit Key, Data

Parameters
Key (String)   The key of the record to edit.
Data (String)   The new data to assign to the specified record.

Notes
If the specified record exists, its data is updated to the value passed in Data.

If multiple records exist with a matching key, only the first record with a matching key is updated.

If the specified record does not exist, no records are affected.

If an error occurs, no records are affected.

Error Values
After calling this function, the property ErrorNumber will report one of the following values:

rtCDP_ErrNoError
rtCDP_ErrRecordNotFound
rtCDP_ErrKeyTooLong
rtCDP_ErrDataTooLong

Example
Objective: Build a short list and then update a record's data.

'Create the object
Dim CDP As rtCDP.rtCompactDataPak
Set CDP = New
rtCDP.rtCompactDataPak
'Append 2 new records
CDP.Append "Name", "John Doe"
CDP.Append "Birthday", "10/12/1964"

This is the current state of the database:

Rec Key Data
0 Name John Doe
1 Birthday 10/12/1964

'Now, edit a record
CDP.Edit "Birthday", "10/12/1974"

This is the current state of the database:

Rec Key Data
0 Name John Doe
1 Birthday 10/12/1974

Version History
1.0 1/30/2001 Tested

See Also
EditArray, EditRec