Purpose
Used to determine the current error number of this object.
Syntax (Read-Only
Property)
Long = object.ErrorNumber
| Long
(Long) |
|
This
function returns the error number that currently exists in the
object.
|
Notes
The only values returned by this property are in the ENum called
rtCDP_ErrorNumber.
When
testing returned error values from this property, you should always
use the values in the ENum rtCDP_ErrorNumber
as opposed to constant values because error numbers are not guaranteed
to stay the same throughout the evolution of this object.
Error
Values
This property does not change the state of the ErrorNumber
property.
Example
Objective:
Check for errors after some function calls.
'Create the object
Dim CDP As
rtCDP.rtCompactDataPak
Set CDP = New rtCDP.rtCompactDataPak
'Add
some records to the database
CDP.Append "Kenny Loggins", "Footloose"
CDP.Append "Faith Hill", "This Kiss"
'Now,
edit one of the records and check for errors
CDP.Edit
"Kenny Loggins", "Vox Humana"
'Check
for errors
Select
Case
CDP.ErrorNumber
Case rtCDP_ErrNoError
MsgBox "The record has been edited"
Case
rtCDP_ErrRecordNotFound
MsgBox
"Error: The record was not found"
Case
rtCDP_ErrKeyTooLong
MsgBox
"Error: The key is too long"
Case
rtCDP_ErrDataTooLong
MsgBox
"The data is too long"
End Select
Version
History
1.0 1/30/2001 Tested