日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ConnectionString Property - ADO

發布時間:2024/4/15 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ConnectionString Property - ADO 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

今天進行一個學生信息系統的查詢開發時,發現老師給的數據庫(Access)有密碼,不知道怎么連接了,在通常的數據連接中,我添加了password屬性后,提示說我的密碼錯誤,無法連接,刷新了一下后提示說:“文件正在使用或其他的程序以獨占的方式打開了”,怎么辦,以前沒有遇到過此類問題啊!傻了,那就看看MSDN 的幫助,以下是查詢的connectionString的說明,簡單的翻譯以下(紅色的部分翻譯得不好,希望大家幫忙看看)。

ConnectionString Property - ADO

Contains the information used to establish a connection to a data source.

提供給connection的數據庫連接的信息,返回值為一個字符串

Applies To

Connection

Settings and Return Values

Sets or returns a String value.

Remarks

Use the ConnectionString property to specify a data source by passing a detailed connection string containing a series of argument = value statements separated by semicolons.

使用ConnectionStrin屬性的一系列的“argument = value”的參數連接到一個特定的數據庫,連接的參數采用“;”隔離。ADO為ConnectionStrin提供7個連接參數,其他的參數直接由提供者而不是ADO。ADO支持的參數如下:

ADO supports seven arguments for the ConnectionString property; any other arguments pass directly to the provider without any processing by ADO. The arguments ADO supports are as follows:

Argument

Description

?

?

Provider=

Specifies the name of a provider to use for the connection.

Data Source=

Specifies the name of a data source for the connection, for example, a SQL Server database registered as an ODBC data source.

User ID=

Specifies the user name to use when opening the connection.

Password=

Specifies the password to use when opening the connection.

File Name=

Specifies the name of a provider-specific file (for example, a persisted data source object) containing preset connection information.

Remote Provider=

Specifies the name of a provider to use when opening a client-side connection. (Remote Data Service only.)

Remote Server=

Specifies the path name of the sever to use when opening a client-side connection. (Remote Data Service only.)

參數

描述

?

?

Provider=

指定連接的提供者

Data Source=

指定連接的數據源。比如:一個SQL服務器數據庫被注冊為ODBC數據源。

User ID=

打開數據庫用戶名

Password=

打開數據庫的密碼

File Name=

Specifies the name of a provider-specific file (for example, a persisted data source object) containing preset connection information.

指定提供者的特定的文件名(例如:一個XX的數據庫對象),該文件包含連接信息

Remote Provider=

當打開一個客戶端連接時,指定一個服務提供名(僅使用于遠程數據庫)

Remote Server=

當打開一個客戶端連接時,指定服務器的名稱(僅使用于遠程數據庫)

?

After you set the ConnectionString property and open the Connection object, the provider may alter the contents of the property, for example, by mapping the ADO-defined argument names to their provider equivalents.

當打開Connection對象,并為其設置了ConnectionString對象時,提供者將顯示屬性的內容。比如:通過影射ADO定義參數,命名提供者的對象。

The ConnectionString property automatically inherits the value used for the ConnectionString argument of the Open method, so you can override the current ConnectionString property during the Open method call.

通過Open方法,ConnectionString能自動的插入參數值,所以通過調用Open方法可以重載當前的ConnectionString屬性。

Because the File Name argument causes ADO to load the associated provider, you cannot pass both the Provider and File Name arguments.

因為File Name參數可以引起ADO加載自定義的提供者,你不能同時加載Provider和File Name參數屬性。

The ConnectionString property is read/write when the connection is closed and read-only when it is open.

Connection關閉時,ConnectionString是可讀寫的;連接打開時,ConnectionString又是只讀的。

Remote Data Service Usage When used on a client-side Connection object, the ConnectionString property can only include the Remote Provider and Remote Server parameters.

遠程數據服務的使用方法:當使用客戶端連接對象時,ConnectionString屬性只包含Remote Provider和Remote Server 參數屬性。

Examples

ConnectionString, ConnectionTimeout, and State Properties Example (VB)

See Also

Using OLE DB Providers with ADO

?

轉載于:https://www.cnblogs.com/AloneSword/archive/2005/11/03/2237647.html

總結

以上是生活随笔為你收集整理的ConnectionString Property - ADO的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。