ErrorOccurred Event

Occurs when the Data Control encounters an error while connecting to the database or when running the query. This event usually indicates:

  • Configuration errors in the connection properties (for example, Provider, Server, Database, etc)
  • Invalid login credentials (User name and Password)
  • Syntax errors in the query, such as an invalid table name, query property value, and so on.

Syntax

object_ErrorOccurred(pError as ErrObject )

NOTE (CIMPLICITY USERS ONLY): The event handler above is named in accordance with the standard VBA naming convention. In CIMPLICITY, this convention is not followed and the default name for this event handler is OnErrorOccurred.  You can use a name of your own choice for the event handler and use the Event tab to associate it with the ActiveX event in question. For some events you may notice that there are already handlers, in which case you should add your own processing to the existing handlers rather than replacing them.

Parameters

The ErrorOccurred event syntax has this part:

Part

Description

object

An object expression that evaluates to an object in the Applies To list.

The event returns a VB Error Object (pError) that contains the specific error number, description, source, and so on as defined in the following table:

Property

Value

Number

The Error code that specifies the error that occurred.

Source

The Name of the component that generated the error.

Description

A string corresponding to the return of the Error function for the specified Number, if this string exists. If the string doesn't exist, Description contains "Application-defined or object-defined error".

HelpFile

The fully qualified drive, path, and file name of the Visual Basic Help file.

HelpContext

The Visual Basic Help file context ID for the error corresponding to the Number property.

LastDLLError

On 32-bit Microsoft Windows operating systems only, contains the system error code for the last call to a dynamic-link library (DLL). The LastDLLError property is read-only.

See Also

Applies to