当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO ConnectionString 属性
The ConnectionString property sets or returns the details used to create a connection to a data source.
ConnectionString属性的作用是:设置或返回用来创建到一个数据源连接的详细设置。
Note: You can not use both the Provider and File Name parameters.
注意:你不能同时使用技术提供对象[provider]和文件名参数。
objconn.ConnectionString="para1=value;para2=value;etc;" |
The ConnectionString property has these parameters:
ConnectionString属性拥有下列参数:
Parameter参数 | Description描述 |
---|---|
Provider | The provider to use for the connection 用于创建连接的技术提供对象[provider] |
File Name | A provider-specific file that contains connection information 包含连接信息的技术提供对象的详细信息 |
Remote Provider | The provider to use when opening a client-side connection 用于打开客户端连接的技术提供对象 |
Remote Server | A path name of the server to use when opening a client-side connection 用于打开客户端连接的服务器路径名 |
url | An absolute URL identifying a resource, such as a file or directory 一个指示资源的绝对路径,比如一个文件或是文件夹 |
<% set conn=Server.CreateObject("ADODB.Connection") conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0" conn.open server.mappath("database.mdb") conn.close %> |