Help Center

CAdoConnection.Stateproperty

Indicates if a `Connection` is open or closed.

DatabasespropertyCAdoConnection.incdocumented

Syntax

PROPERTY State () AS LONG

Return value

The current connection state.

Description

Indicates if a Connection is open or closed.

Remarks

You can use the State property to determine the current state of a given object at any time.

The object's State property can have a combination of values. For example, if a statement is executing, this property will have a combined value of adStateOpen and adStateExecuting.

Example

IF pConnection.State = adStateOpen THEN pConnection.Close

Reference

  • Include file CAdoConnection.inc
  • Defined in AfxNova/CAdoConnection.inc:240
  • Documented in Databases/ADO Classes/CAdoConnection Class.md
  • Topic: CAdoConnection Class