Name

Connection.ConnectionString Property — (Versions 2.0, 2.1, 2.5, 2.6)

Synopsis

                     connection.ConnectionString = connectionstring
                  

The ConnectionString property defines the connection used to access a data source.

Datatype

String

Description

The ConnectionString property indicates the data source to be used by your connection. You may pass either a DSN (data source name) or a detailed connection string, which is a list of arguments. The arguments must be in the form of argument=value, with multiple arguments separated by a semicolon. If ADO finds an equal sign in the ConnectionString property, it assumes that you are passing a detailed connection string.

Arguments

The three supported arguments are listed next. If you pass additional arguments, they are passed directly to the data provider and are not checked by ADO:

Provider

Specifies the name of the data provider to use for the particular connection.

Filename

Specifies the name of a data provider-specific file containing connection information. This argument cannot be used with the Provider argument.

URL

Identifies the absolute URL of a file or directory.

The contents of the ConnectionString property can be altered by ADO at any time after opening the Connection object, so read the property if you are unsure of its contents.

If the ConnectionString argument was used in the Open method of the Connection object, the value is placed within the ConnectionString property of the Connection object.

While the Connection object is open, the ConnectionString ...

Get ADO: ActiveX Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.