CAdoRecord.ActiveConnectionproperty
Indicates to which `Connection` object the specified `Record` object currently belongs.
Syntax
PROPERTY ActiveConnection (BYREF vConn AS DVARIANT)
PROPERTY ActiveConnection (BYVAL pconn AS Afx_ADOConnection PTR)
PROPERTY ActiveConnection (BYREF pconn AS CAdoConnection)
PROPERTY ActiveConnection () AS Afx_ADOConnection
Parameters
| Name | Description | |
|---|---|---|
vConn | A string value that contains a definition for a connection if the connection is closed, or a Variant containing the current Connection object if the connection is open. | |
pconn | A reference to the Connection object or to the 'CAdoConnection` class. |
Return value
A reference to the Afx_ADOConnection object. You must release it calling the Release method when no longer needed.
Description
Sets or returns a string value that contains a definition for a connection if the connection is closed, or a Variant containing the current Connection object if the connection is open. Default is a null object reference.
Remarks
Sets or returns a string value that contains a definition for a connection if the connection is closed, or a Variant containing the current Connection object if the connection is open. Default is a null object reference. See the ConnectionString property in the documentation for the ' CAdoConnection` class.
This property is read/write when the Record object is closed, and may contain a connection string or reference to an open Connection object. This property is read-only when the Record object is open, and contains a reference to an open Connection object.
A Connection object is created implicitly when the Record object is opened from a URL. Open the Record with an existing, open Connection object by assigning the Connection object to this property, or using the Connection object as a parameter in the Open method call. If the Record is opened from an existing Record or Recordset, then it is automatically associated with that Record or Recordset object's Connection object.
Note: URLs using the http scheme will automatically invoke the Microsoft OLE DB Provider for Internet Publishing.
Reference
- Include file
CADORecord.inc - Defined in AfxNova/CAdoRecord.inc:188
- Documented in Databases/ADO Classes/CAdoRecord Class.md
- Topic: CAdoRecord Class