EditArray

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

Syntax (Method)
object.EditArray Key, Instance, Data

Parameters
Key (String)   The key of the record to edit.
Instance (Long)  

This is the instance of the record named with the specified key you want to work with.

Key and Instance work together to specify a record. For example, if Instance is 3, then the property specifies the 4th (zero-based) record that is named Key.

This parameter is zero-based.

Negative values are bound to zero (0).

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 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_ErrKeyTooLong
rtCDP_ErrDataTooLong
rtCDP_ErrRecordNotFound

Example
Objective: Edit a record in the database.

'Create the object
Dim CDP As rtCDP.rtCompactDataPak
Set CDP = New
rtCDP.rtCompactDataPak
'Append 2 new records
CDP.Append "Name", "Steve Perry"
CDP.Append "Name", "Kevin Kronin"

This is the current state of the database:

Rec Key Data
0 Name Steve Perry
1 Name Kevin Kronin

'Now, edit a record
CDP.Edit "Name", 1, "Tommy Shaw"

This is the current state of the database:

Rec Key Data
0 Name Steve Perry
1 Name Tommy Shaw

Version History
1.0 2/1/2001 Tested

See Also
Edit, EditRec