RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TADOConnection.ConnectionString Property

Specifies the connection information for the data store.

Pascal
property ConnectionString: WideString;
C++
__property BSTR ConnectionString;

Set ConnectionString to specify the information needed to connect the ADO connection 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.

ADOConnection1.ConnectionString := 'Provider=ProviderRef;Remote Server=ServerRef';

 

ADOConnection1->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. 

When explicitly passing login information through either the Open method or the ConnectionString, the LoginPrompt property should be set to false to prevent an unnecessary login dialog. 

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 
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.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!