ADODB Object
 
Syntax
 
string = connectionobject.ConnectionString
connectionobject.ConnectionString = string
 
Description
Sets or returns a string value that contains the details used to create a connection to a data source.
 
The ConnectionString property can be used to set or return a string that contains the information needed to establish a connection to a data source. The string is typically composed of a series of parameter=value statements that are separated by semicolons. After you complete the connection, the provider may alter these ADO parameter=value statements to the provider equivalents.
 
Note that the ConnectionString string is also passed as part of the Open method call of the Connection object. The values of ConnectionString parameter of the method call are automatically inherited by the ConnectionString property. Therefore, these values are set by the Open method. (Also, the Open method allows the optional use of a user ID and password.)
 
ADO supports five arguments for the connection string:
 
File Name= is the name of a file that contains the connection information. If you use this parameter, you cannot use the Provider= parameter.
 
Provider= is the name of the provider. If you use this parameter, you cannot use the File Name= parameter.
 
Remote Provider= is the name of the provider that you use when you open a client-side connection. (for Remote Data Service)
 
Remote Server= is the path name to the server that you use when you open a client-side connection. (for Remote Data Service)
 
URL= is the absolute URL address to use for the connection.
 
Note: Duplicate parameters are ignored and only the last occurrence of a repeated parameter is used.
See Also
Example
 
Dim objConnection
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.ConnectionString =
      "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=ADOData.mdb;
objConnection.ConnectionTimeout = 0
objConnection.Open
 
 
'OLE DB Provider for Active Directory Service:
"Provider=ADSDSOObject;"
 
'OLE DB Provider for Index Server:
"Provider=MSIDXS;"
 
'OLE DB Provider for Internet Publishing:
"Provider=MSDAIPP.DSO; Data Source=http://www.mysite.com/pubs_dir"
 
'OLE DB Provider for Microsoft Jet:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=AccessData.mdb;"
 
'OLE DB Provider for ODBC Databases:
"Provider=MSDASQL; Driver={SQL Server}; Server=MyServer;
DataBase=MyDatabase;"
 
'OLE DB Provider for Oracle:
"Provider=MSDAORA; Data Source=MyTable;"<
 
'OLE DB Provider for SQL Server:
"Provider=SQLOLEDB; Data Source=GuruServer; Network Library=DBMSSOCN;
Initial Catalog=Tradium;"