亚洲色偷偷一区二区手机在线_国产一卡2卡3卡4卡有限公司_日产精品一至六区_国产成人不卡无码免费视频

星輝互聯(lián)

您的當前位置:網(wǎng)站首頁 » 幫助中心» 云主機

如何連接ACCESS數(shù)據(jù)庫?

來源:星輝互聯(lián)類型:幫助文件 更新:2007-5-21 點擊:5481

  本站整理出四種常用的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 (該項在本站僅適用于MSSQL)
set conn=server.createobject("Adodb.connection") 
conn.open "DSN=xxx;UID=;PWD=;Database=customer 
 

我們很樂意幫助您!請聯(lián)系在線客服或致電我們。7×24小時客服熱線: 0833-2438125