| InfoToday Tools for Visual Rams |
| Checking for Errors |
loITRDS.SetConnection("INVALIDCODE")
To determine if an error occurred, you need to look at the property lError. This property will be True if an error occurred and False if not. To obtain the error message you need to look at the cErrorMsg property. Both these properties are on every object within the ITRDS
Hence a common structure for issuing commands with the ITRDS would be
If loITRDS.oConnection.lError
lcErrorMessage = loITRDS.oConnection.cErrorMsg
Wait Window lcErrorMessage
Return .F.
NB: This is a bit of a special case in that you needed to know that the "SetConnection" command will place it's errors in the
oConnection object. Generally though this will not be a problem as in 99% of cases the methods are always performed on the
appropriate object (shown later on)