ADODB Object
 
Syntax
 
long = errorobject.Number
 
Description
Returns a long value that is the unique number that identifies an Error object.
 
The Number property returns a long value that should correspond to one of the ErrorValueEnum constants, which are unique ADO numbers that describe the error being reported.
 
The numbers can be a positive decimal, a negative decimal, or a hexadecimal value, and are equivalent to the Windows API HRESULTS values. For a warning, the number property will be zero.
 
Remember that errors are reported by ADO, but that they can be generated by either ADO or the underlying provider (data source). If the error was generated by the provider, the Number property may be set to an unspecific error value, such as:
 
Value
Description
-2147217900
0x80040E14
Unspecified
-2147467259
0x80004005
Unspecified
 
 
ErrorValueEnum Constants 
 
Constant
Value
Description
adErrBoundToCommand
3707
-2146824581
0x800A0E7B
Cannot change the ActiveConnection property
adErrCannotComplete
3732
-2146824556
0x800A0E94
Cannot complete operation
adErrCantChangeConnection
3748
-2146824540
0x800A0EA4
New connection has different characteristics from one in use
adErrCantChangeProvider
3220
-2146825068
0x800A0C94
Provider is different from one is use
adErrCantConvertvalue
3724
-2146824564
0x800A0E8C
Data value cannot be converted
adErrCantCreate
3725
-2146824563
0x800A0E8D
Data value cannot be set or returned due to wrong data type or insufficient resources
adErrCatalogNotSet
3747
-2146824541
0x800A0EA3
Need a valid ParentCatalog
adErrColumnNotOnThisRow
3726
-2146824562
0x800A0E8E
Record not in this field
adErrDataConversion
3421
-2146824867
0x800A0D5D
 
Value has wrong type
adErrDataOverflow
3721
-2146824567
0x800A0E89
Data value too large
adErrDelResOutOfScope
3738
-2146824550
0x800A0E9A
URL to be deleted is out of scope
adErrDenyNotSupported
3750
-2146824538
0x800A0EA6
Sharing restrictions not supported by provider
adErrDenyTypeNotSupported
3751
-2146824537
0x800A0EA7
Requested sharing restriction not recognized by provider
adErrFeatureNotAvailable
3251
-2146825037
0x800A0CB3
Cannot perform requested operation
adErrFieldsUpdateFailed
3749
-2146824539
0x800A0EA5
Update failed, check Status property
adErrIllegalOperation
3219
-2146825069
0x800A0C93
Operation not allowed
adErrIntegrityViolation
3719
-2146824569
0x800A0E87
Data value violates integrity constraints
adErrInTransaction
3246
-2146825042
0x800A0CAE
Cannot close Connection
adErrInvalidArgument
3001
-2146825287
0x800A0BB9
Arguments are wrong type, out of range, or conflict
adErrInvalidConnection
3709
-2146824579
0x800A0E7D
Calling a closed or invalid Connection
adErrInvalidParamInfo
3708
-2146824580
0x800A0E7C
Invalid Parameter object information
adErrInvalidTransaction
3714
-2146824574
0x800A0E82
Invalid transaction or not started
adErrInvalidURL
3729
-2146824559
0x800A0E91
Invalid URL address
adErrItemNotFound
3265
-2146825023
0x800A0CC1
Item not found in collection
adErrNoCurrentRecord
3021
-2146825267
0x800A0BCD
At BOF, or EOF, or no record exists
adErrNotExecuting
3715
-2146824573
<0x800A0E83
Operation not executing
adErrNotReentrant
3710
-2146824578
0x800A0E7E
Operation cannot proceed while firing event
adErrObjectClosed
3704
-2146824584
0x800A0E78
Cannot perform operation while closed
adErrObjectInCollection
3367
-2146824921
0x800A0D27
Cannot append object already in collection
adErrObjectNotSet
3420
-2146824868
0x800A0D5C
Invalid Object
adErrObjectOpen
3705
-2146824583
0x800A0E79
Cannot perform operation while object is open
adErrOpeningFile
3002
-2146825286
0x800A0BBA
Cannot open file
adErrOperationCancelled
3712
-2146824576
0x800A0E80
User cancelled operation
adErrOutOfSpace
3734
-2146824554
0x800A0E96
Out of memory
adErrPermissionDenied
3720
-2146824568
0x800A0E88
Permission denied to write to field
adErrPropConflicting
3742
-2146824546
0x800A0E9E
Property values conflict with each other
adErrPropInvalidColumn
3739
-2146824549
0x800A0E9B
Cannot apply property to field
adErrPropInvalidOption
3740
-2146824548
0x800A0E9C
Attribute property invalid
adErrPropInvalidValue
3741
-2146824547
0x800A0E9D
Invalid property value
adErrPropNotAllSettable
3743
-2146824545
0x800A0E9F
Cannot set property or read-only
adErrPropNotSet
3744
-2146824544
0x800A0EA0
Optional property value not set
adErrPropNotSettable
3745
-2146824543
0x800A0EA1
Read-only property cannot be set
adErrPropNotSupported
3746
-2146824542
0x800A0EA2
Property not supported by provider
adErrProviderFailed
3000
-2146825288
0x800A0BB8
Provider failed to perform operation
adErrProviderNotFound
3706
-2146824582
0x800A0E7A
Cannot find provider
adErrReadFile
3003
-2146825285
0x800A0BBB
Cannot read file
adErrResourceExists
3731
-2146824557
0x800A0E93
Use adCopyOverwite to replace object that already exists
adErrResourceLocked
3730
-2146824558
0x800A0E92
Object is locked until processing completed
adErrResourcesOutOfScope
3735
-2146824553
0x800A0E97
Resource outside scope of current record
adErrSchemaViolation
3722
-2146824566
0x800A0E8A
Data type or constraints conflict with data value
adErrSignMismatch
3723
-2146824565
0x800A0E8B
Data value is signed and field data is unsigned
adErrStillConnecting
3713
-2146824575
0x800A0E81
Operation cannot be performed until connection completed
adErrStillExecuting
3711
-2146824577
0x800A0E7F
Cannot perform operation while executing
adErrTreePermissionDenied
3728
-2146824560
0x800A0E90
Permissions prohibit accessing tree or subtree
adErrUnavailable
3736
-2146824552
0x800A0E98
Operation failed and status unavailable
adErrUnsafeOperation
3716
-2146824572
0x800A0E84
Cannot access data source in another domain
adErrURLDoesNotExist
3727
-2146824561
0x800A0E8F
URL cannot be found
adErrURLNamedRowDoesNotExist
3737
-2146824551
0x800A0E99
This record does not exist
adErrVolumeNotFound
3004
-2146824555
0x800A0E95
Provider cannot find the URL of the storage device
adErrWriteFile
3004
-2146825284
0x800A0BBC
Failed to write to file
adWrnSecurityDialog
3717
-2146824571
0x800A0E85
Not used
adWrnSecurityDialogHeader
3718
-2146824570
0x800A0E86
Not used
See Also
Example
 
Dim ErrorInfo As String
 
For Each objError in objConnection
   ErrorInfo = "Description; " & objError.Description & vbNewline & _
      "Help Context: " & objError.HelpContext & vbNewline & _
      "Help File: " & objError.HelpFile & vbNewline & _
      "Native Error: " & objError.NativeError & vbNewline & _
      "Number: " & objError.Number & vbNewline & _
      "Source: " & objError.Source & vbNewline & _
      "SQL State: " & objError.SQLState & vbNewline
 
   Debug.Print ErrorInfo
Next