本站整理出四種常用的access連接方式,當(dāng)然,第1種這是最常用的(推薦使用)。
1. 
set dbconnection=Server.CREATEOBJECT("ADODB.CONNECTION") 
DBPath = Server.MapPath("customer.mdb") //customer.mdb是您的數(shù)據(jù)庫(kù)名,您可以在前面加上路徑
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 (該項(xiàng)在本站僅適用于MSSQL)
set conn=server.createobject("Adodb.connection") 
conn.open "DSN=xxx;UID=;PWD=;Database=customer
地 址:北京市海淀區(qū)建材城中路12號(hào)院17號(hào)樓1層119室
		
武漢分公司地址:湖北省武漢市洪山區(qū)南國(guó)雄楚廣場(chǎng)A4棟2011室
		
鄭州分公司地址:河南鄭州金水區(qū)東風(fēng)路科技市場(chǎng)對(duì)面米蘭陽(yáng)光6號(hào)樓917室
郵 箱:haidanet@163.com
24小時(shí)聯(lián)系電話: 15201609116    13651084380