******************************
Do you refer to this page regularly? If so, I'd welcome your direct comments on how this does or does not answer your scripting needs. Please email the FAQ author so I can improve the FAQ in this area.
******************************
When an operation fails, Document.LastError is set to the custom error code. For successful calls the LastError value will be zero.
Thus while most functions themselves return a success/failure flag, interrogation of LastError will (may) indicate the actual cause, e.g. that you are trying to open as admin a catalogue that is already open in admin (noting admin needs single user unique access).
In simple terms, if the method's success flag is true, proceed as intended; if false, get the LastError value and take according action through an error handler.
KScriptNoError | 0 | No Error (Success) |
KScriptBadPassword | 1 | Incorrect/Invalid Password |
KScriptCatInUse | 2 | Catalogue is currently in use and therefore cannot be opened in this mode. This error code is not actually used in the client's code and therefore should not be encountered. |
KScriptAdminCatInUse | 3 | Attempting to open a Catalogue in Admin mode whilst there are other users |
KScriptAdminInUse | 4 | Someone else is already logged in as Admin |
KScriptReadOnlyAvailable | 5 | Catalogue is only available in read-only mode i.e. on a read-only volume |
KScriptServedAdminError | 6 | Opening a served Catalogue in Admin (or Browser) mode |
KScriptUnknownCatError | 7 | Unknown error trying to open Catalogue |
KScriptInvalidMode | 8 | Invalid mode |
KScriptNoFileName | 9 | No Filename |
KScriptDiskFull | 10 | Disk full |
KScriptErrorCreate | 11 | Error creating Catalogue |
kScriptInvalidFieldname | 12 | Invalid Field name |
kScriptFieldNotIndex | 13 | Field isn't indexed |
kScriptFieldNotMultiVal | 14 | Field isn't multivalue |
kScriptIndexOutOfRange | 15 | Index out of range |
kScriptEmptyValue | 16 | Empty value |
kScriptInvalidValueforFieldType | 17 | Value is invalid for given Field type |
kScriptValueNotInPredefList | 18 | Value is not in pre-defined list |
kScriptCatalogNotFound | 19 | Catalogue could not be found |
kScriptServerNotFound | 20 | Server could not be found |
kScriptMaxServerConnected | 21 | Maximum allowed number server connections reached (someone must log off) |
kScriptInvalidFieldValue1 | 22 | Invalid FieldValue Field 1 |
kScriptInvalidFieldValue2 | 23 | Invalid FieldValue Field 2 |
kScriptInvalidGallery | 24 | Invalid Gallery |
kScriptInvalidQuery | 25 | Invalid Query (Find) specification |
kScriptSystemField | 26 | Can't change system (built-in) Field |
kScriptGalleryNotFound | 27 | Gallery Not Found |
kScriptFieldNotPredefined | 28 | Field Not of pre-defined Type |
kScriptInvalidCatalogOption | 29 | Invalid Cataloguing option |
kScriptInvalidHTMLSetName | 30 | Invalid HTML saved set name |
kScriptCreatingHTMLImagesDir | 31 | Error Creating HTML Images Directory |
kScriptCreatingHTMLFile | 32 | Error Creating HTML File |
kScriptWritingHTMLFile | 33 | Error writing to HTML file |
kScriptOutOfMemory | 34 | Out of memory |
kScriptCopyError | 35 | Copy error (GalleryCopy) |
kScriptServerDisconnect | 36 | Server disconnected |
kScriptInvalidForFoundItems | 37 | Can't perform on "found items" gallery |
kScriptInvalidLoginMode | 38 | Attempting to open user-based catalogue with level-based API |
kScriptUnknownError | 1000 | Unknown Error opening/creating catalogue |
Question: Error codes for the VB automation TLB [FAQ00141.htm]
Last Update:- 01 June 2006
Site and articles © Mark Anderson 2001-2007 - Visit my home page