OpenConnection Method

Establishes connection with a database and creates a new Connection object.

Applies to objects: Workspace.

Syntax

[[Set] RetVal = ] object.OpenConnection([Name], [Exclusive], [ReadOnly], [ConnectionString])

The OpenConnection method syntax has these parts:

Part Description
object Required. A reference to an instance of the object.
RetVal Optional. A Connection type variable.
Name Optional. A String type variable. The name of the connection being created.
Exclusive Optional. A Boolean type variable. A flag that indicates that database resources, used by the user will be blocked for other users. The default value is FALSE.
ReadOnly Optional. A Boolean type variable. A flag, that indicates that the database is opened only for reading. The default value is FALSE.
ConnectionString Optional. A String type variable. The connection initialization string.

Remarks

If the connection initialization string is omitted or doesn't contain the necessary parameters, the necessary information will be taken from the Workspace object.

Example

.......

 

See Also

Connection Object, Workspace Object, OpenDatabase Method.