日韩亚洲一区,二区,三区,日产精品一卡2卡三卡四卡区别 ,日韩欧美a综合网站,三级4级全黄60分钟,日产电影一区二区三区

SHOPEX網(wǎng)店
數(shù)字證書
代理相關(guān)
網(wǎng)絡(luò)推廣

幫助中心 數(shù)據(jù)庫 相關(guān)技術(shù)支持

網(wǎng)站程序中常見的數(shù)據(jù)庫連接方法

文章來源:美橙互聯(lián)    

本站整理出四種常用的access連接方式,當然,第1種這是最常用的(推薦使用)。
1.
set dbconnection=Server.CreateOBJECT("ADODB.CONNECTION")
DBPath = Server.MapPath("customer.mdb") //customer.mdb是您的數(shù)據(jù)庫名,您可以在前面加上路徑
dbconnection.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
SQL="select * from auth where id='" & user_id &"'"
SET uplist=dbconnection.EXECUTE(SQL)
2.
set dbconnection=Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("customer.mdb")
dbconnection.Open "provider=microsoft.jet.oledb.4.0;data source="&dbpath
SQL="select * from auth where id='" & user_id &"'"
SET uplist=dbconnection.EXECUTE(SQL)
3.
DBPath = Server.MapPath("customer.mdb")
set session("rs")=Server.CreateObject("ADODB.Recordset")
' rs=Server.CreateObject("ADODB.Recordset")
connstr="provider=microsoft.jet.oledb.4.0;data source="&dbpath
SQL="select * from auth where id='" & user_id &"'"
session("rs").Open sql,connstr,1,3
4.
建odbc源xxx (該項僅適用于獨立主機用戶,虛擬主機不支持數(shù)據(jù)源)
set conn=server.createobject("Adodb.connection")
conn.open "DSN=xxx;UID=;PWD=;Database=customer

  SQL數(shù)據(jù)庫  
  conn="Driver={SQL   Server};Server=數(shù)據(jù)庫服務(wù)器名稱或者數(shù)據(jù)庫IP地址;Database=數(shù)據(jù)庫名;UID=登錄用戶名;PWD=登錄密碼"  
  Access數(shù)據(jù)庫  
  conn="Provider=Microsoft.Jet.OLEDB.4.0;Data   Source="&server.mappath("數(shù)據(jù)庫名.mdb")

準備開展業(yè)務(wù)? 立即創(chuàng)建網(wǎng)站成為代理商

遇到了問題?

24小時在線客服

電話

400-920-99337*24小時客服服務(wù)熱線

微信掃碼溝通