国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

樣設置為使用OLEDB連接我的Access數據庫?

2019-11-18 20:34:52
字體:
來源:轉載
供稿:網友
Before you begin you should check to make sure that you have MDAC v2.1 SP2 or later installed on yourserver. To get the latest MDAC goto http://www.microsoft.com/data. If you are unsure which version of MDAC you have installed Microsoft PRovides a tool called ComCheck which will tell you.

A basic OLEDB Connection String looks like this:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/db1.mdb"
Of course you will have to replace the path above ("c:/db1.mdb") with the path and filename of your own database. If the database is located on an ISP's server and you don't know the physical path of your database you can use the Server.Mappath() function. Eg:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("/db1.mdb") However it is not recommended that you place your database in a folder that has IIS read permissions enabled (as any casual web-browser will be able to download the file if the filename is known).

It is recommended that you assign your connection string to an application level global variable or create an include file that contains code that assigns the connection string to a local variable (with the include file being included on each page that requires a database connection). This way if your database ever changes you only need to make one change to your code to enable it to connect to your new database.
Eg (in your global.asa):
Sub Application_OnStart
Application("strDBConnectionString") = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/db1.mdb"
End Sub
You may need to specify additional parameters for the connection string (eg a User ID and PassWord, if you have placed a UserName/Password restriction on the database).

The following is a list of additional parameters that can go into the connection string. Each parameter takes the form of:

parameter name=value
and is separated from the next parameter by a ;

User ID (default: User ID=Admin)
Password (default: Password="")
Mode
Extended Properties
Jet OLEDB:System
Jet OLEDB:Registry Path
Jet OLEDB:Database Password
Jet OLEDB:Engine Type
Jet OLEDB:Database Locking Mode
Jet OLEDB:Global Partial Bulk Ops
Jet OLEDB:Global Bulk Transactions
Jet OLEDB:New Database Password
Jet OLEDB:Create System Database
Jet OLEDB:Encrypt Database
Jet OLEDB:Don't Copy Locale on Compact
Jet OLEDB:Compact Without Replica Repair
Jet OLEDB:SFP

For a comprehensive list of connection strings (access or otherwise) check out this page over at Able
Consulting.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 沭阳县| 高邮市| 辽源市| 新河县| 阿瓦提县| 潮安县| 巩留县| 九台市| 长乐市| 宁海县| 衢州市| 辽阳市| 金乡县| 隆林| 建瓯市| 舟山市| 雅江县| 萍乡市| 碌曲县| 宜昌市| 安徽省| 巴南区| 星座| 定远县| 常德市| 永仁县| 伊宁县| 北宁市| 慈溪市| 霸州市| 虞城县| 黔江区| 民权县| 西乌珠穆沁旗| 常德市| 遂昌县| 延津县| 桃园县| 修武县| 甘洛县| 邢台市|