Provider Property

The Provider property on a Connection object indicates the name of the provider. This property sets or returns a String value.

oldProvider = currentConnection.Provider
currentConnection.Provider = "SNAOLEDB"
 

Remarks

The Provider property is used to set or return the name of the provider for the connection. This property can also be set by the contents of ConnectionString property or the ConnectionString argument of the Open method. However, specifying a provider in more than one place while calling the Open method can have unpredictable results. If no provider is specified, the property will default to MSDASQL (Microsoft OLE DB Provider for ODBC). The OLE DB Provider for AS/400 and VSAM requires "SNAOLEDB" as the Provider property string.

The Provider property is read/write when the connection is closed and read-only when it is open. The setting does not take effect until either the Connection object is opened or the Properties collection of the Connection object is accessed. If the setting is invalid, an error occurs.