Table of contents
TOC
Collapse the table of content
Expand the table of content

CurrentProject.OpenConnection Method (Access)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

You can use the OpenConnection method to open an ADO connection to an existing Microsoft Access project (.adp) or Access database as the current Access project or database in the Microsoft Access window.

Syntax

expression. OpenConnection( ** BaseConnectionString, ** UserID, ** Password** )

expression A variable that represents a CurrentProject object.

Parameters

NameRequired/OptionalData TypeDescription
BaseConnectionStringOptionalVariantA string expression that is the base connection string of the database.
UserIDOptionalVariantA string expression that is the name of the existing Access project, including the path name and the file name extension. If your network supports it, you can also specify a network path in the following form: \Server\Share\Folder\Filename.adp
PasswordOptionalVariantIf you don't supply the filename extension, .adp is appended to the filename. You can use this method or the OpenCurrentDatabase method to open .adp files.

Remarks

The OpenConnection method is similar to the Open method of an ADO Connection object. This method establishes the physical connection to the data source. After this method successfully completes, the connection is live, the Connection and BaseConnectionString properties are set, and the Database window or data access page should be repopulated with data from the new connection. All parameters of this method are optional. If no base connection string is supplied, then the connection is re-established using the previous base connection string (but the user must call CloseConnection before calling OpenConnection again). In the case of an Access project, the BaseConnectionString property can only specify the SQL Server OLE DB Provider.

See also

Concepts

CurrentProject Object

© 2018 Microsoft