EditRec

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

Syntax (Method)
object.EditRec Key, Data, Index

Parameters
Key (String)   The key to assign to the specified record.
Data (String)  

The data to assign to the specified record.

Index (Long)  

This is the record number of the record you want to edit.

This parameter is zero-based (the first record is record number zero).

Notes
If the specified record exists, its key and data are 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_ErrKeyTooLong
rtCDP_ErrDataTooLong
rtCDP_ErrRecordNotFound

Example
Objective: Manage a list of movies and songs.

'Create the object
Dim CDP As rtCDP.rtCompactDataPak
Set CDP = New
rtCDP.rtCompactDataPak
'Append 2 new records
CDP.Append "Movie", "Terminator"
CDP.Append "Movie", "Alien"
CDP.Append "Movie", "Lovin' Touchin' Squeezin'"

This is the current state of the database:

Rec Key Data
0 Movie Terminator
1 Movie Alien
2 Movie Lovin' Touchin' Squeezin'

'Now, edit a record
CDP.EditRec "Song",
"Lovin' Touchin' Squeezin'", 2

This is the current state of the database:

Rec Key Data
0 Movie Terminator
1 Movie Alien
2 Song Lovin' Touchin' Squeezin'

Version History
1.0 2/1/2001 Tested

See Also
Edit, EditArray