--- title: "ConnectionString Property (ADO) | Microsoft Docs" ms.prod: sql ms.prod_service: connectivity ms.technology: connectivity ms.custom: "" ms.date: "01/19/2017" ms.reviewer: "" ms.topic: conceptual apitype: "COM" f1_keywords: - "Connection15::ConnectionString" helpviewer_keywords: - "ConnectionString property [ADO]" ms.assetid: 3be75b75-4d36-4479-ab64-9a456869252a author: MightyPen ms.author: genemi --- # ConnectionString Property (ADO) Indicates the information used to establish a connection to a data source. ## Settings and Return Values Sets or returns a **String** value. ## Remarks Use the **ConnectionString** property to specify a data source by passing a detailed connection string containing a series of *argument* *= value* statements separated by semicolons. ADO supports five arguments for the **ConnectionString** property; any other arguments pass directly to the provider without any processing by ADO. The arguments ADO supports are as follows. |Argument|Description| |--------------|-----------------| |*Provider=*|Specifies the name of a provider to use for the connection.| |*File Name=*|Specifies the name of a provider-specific file (for example, a persisted data source object) containing preset connection information.| |*Remote Provider=*|Specifies the name of a provider to use when opening a client-side connection. (Remote Data Service only.)| |*Remote Server=*|Specifies the path name of the server to use when opening a client-side connection. (Remote Data Service only.)| |*URL=*|Specifies the connection string as an absolute URL identifying a resource, such as a file or directory.| After you set the **ConnectionString** property and open the [Connection](../../../ado/reference/ado-api/connection-object-ado.md) object, the provider may alter the contents of the property, for example, by mapping the ADO-defined argument names to their equivalents for the specific provider. The **ConnectionString** property automatically inherits the value used for the *ConnectionString* argument of the [Open](../../../ado/reference/ado-api/open-method-ado-connection.md) method, so you can override the current **ConnectionString** property during the **Open** method call. Because the *File Name* argument causes ADO to load the associated provider, you cannot pass both the *Provider* and *File Name* arguments. The **ConnectionString** property is read/write when the connection is closed and read-only when it is open. Duplicates of an argument in the **ConnectionString** property are ignored. The last instance of any argument is used. > [!NOTE] > **Remote Data Service Usage** When used on a client-side **Connection** object, the **ConnectionString** property can include only the *Remote Provider* and *Remote Server* parameters. The following table lists the default ADO provider for each Windows operating system: |Default ADO provider|Windows operating system| |--------------------------|------------------------------| |MSDASQL

(To improve the readability of source code, explicitly specify the provider name in the connection string.)|Windows 2000 (32-bit)

Windows XP (32-bit)

Windows 2003 Server (32-bit)

Windows Vista (32-bit)

Windows Vista Service Pack 1 or later (32-bit and 64-bit)

Windows versions after Windows Vista (32-bit and 64-bit)| |No default.

When an ADO application runs on the following operating systems and does not specify the provider explicitly, ADO returns the following error: "ADODB.Connection: provider is not specified and there is no designated default provider"|Windows 2000 (64-bit)

Windows XP (64-bit)

Windows 2003 Server (64-bit)

Windows Vista (64-bit)| ## Applies To [Connection Object (ADO)](../../../ado/reference/ado-api/connection-object-ado.md) ## See Also [ConnectionString, ConnectionTimeout, and State Properties Example (VB)](../../../ado/reference/ado-api/connectionstring-connectiontimeout-and-state-properties-example-vb.md) [ConnectionString, ConnectionTimeout, and State Properties Example (VC++)](../../../ado/reference/ado-api/connectionstring-connectiontimeout-and-state-properties-example-vc.md) [Appendix A: Providers](../../../ado/guide/appendixes/appendix-a-providers.md)