ConnectionString Property

Microsoft Access Visual Basic

object. Read/write String.

expression.ConnectionString

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

The ConnectionString property is available only by using Visual Basic and is read-only.

The ConnectionString property returns the connection string that was set through the OpenConnection method or by clicking Connection on the File menu. When making a connection, Microsoft Access project modifies the ConnectionString property for use with the ADO environment. The Microsoft Office Data Source Control (MSODSC) likewise modifies the ConnectionString.

Example

The following example displays the ConnectionString property setting of the currently active data access page:

Dim objCurrent As Object
Set objCurrent = Application.DataAccessPages(0)
MsgBox "The current base connection is " _
    & objCurrent.ConnectionString