ADO ConnectionString Property
Definition and Usage
The ConnectionString property can be set or returned to provide information for establishing a connection to the data source.
Note:You cannot use the Provider and File Name parameters at the same time.
Syntax
objconn.ConnectionString="para1=value;para2=value;etc;"
The ConnectionString property has 5 parameters:
Parameters | Description |
---|---|
Provider | The name of the provider used for the connection. |
File Name | The name of a provider-specific file (such as a persistent data source object) that contains predefined connection information. |
Remote Provider | The name of the provider used when opening a client connection. (Limited to Remote Data Services only.) |
Remote Server | The path name of the server used when opening a client connection. (Limited to Remote Data Services only.) |
url | An absolute URL that identifies a resource (such as a file or directory). |
Example
<% set conn=Server.CreateObject("ADODB.Connection") conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0" conn.open server.mappath("database.mdb") conn.close %>