Data.Win.ADODB.TCustomADODataSet.ConnectionString
Delphi
property ConnectionString: WideString read GetConnectionString write SetConnectionString;
C++
__property System::WideString ConnectionString = {read=GetConnectionString, write=SetConnectionString};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | published | Data.Win.ADODB.pas Data.Win.ADODB.hpp |
Data.Win.ADODB | TCustomADODataSet |
Description
Specifies the connection information for the data store.
Set ConnectionString to specify the information needed to connect the ADO dataset component to the data store. The value used for ConnectionString consists of one or more arguments ADO uses to establish the connection. Specify multiple arguments as a list with individual arguments separated by semicolons.
ADOQuery1.ConnectionString := 'Provider=ProviderRef;Remote Server=ServerRef';
ADOQuery1->ConnectionString = "Provider=ProviderRef;Remote Server=ServerRef";
At design-time, select from the list of available ADO database connections invoked from the Object Inspector.
A connection string may be saved to file for later use. Specify only the name of such a file in ConnectionString to reuse a saved connection string.
The connection string may also contain login information such as user ID and password, for automated logins.
ADO supports the following four arguments for connection strings. Any other arguments (such as a user ID and password) are not processed by ADO and simply passed on to the provider.
Argument | Meaning |
---|---|
Provider |
The name of the provider to use for the connection. |
File name |
The name of a file containing connection information. |
Remote Provider |
The name of the provider to use for a client-side connection. |
Remote Server |
The path name of the server to use for a client-side connection. |
Note: After opening a connection, the contents of ConnectionString may be changed by ADO. One example of this behavior is when ADO-defined arguments are mapped to their provider equivalents.