帮助中心
您现在的位置:首 页>> 帮助中心

如何连接ACCESS数据库?

本站整理出四种常用的access连接方式,当然,第1种这是最常用的(推荐使用)。
1>
set dbconnection=Server.CREATEOBJECT("ADODB.CONNECTION")
DBPath = Server.MapPath("customer.mdb") //customer.mdb是您的数据库名,您可以在前面加上路径
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
 



关于我们 | 网站地图 | 如何交费 | 代理合作 | 招聘信息 | 联系我们 | 资质证明  

《中华人民共和国增值电信业务经营许可证》ISP证编号:皖B2-20070030
版权所有:合肥开拓网络科技有限公司 电话:0551-5552811 传真:0551-5552811 公司邮件:kltxh@163.com邮编:230022

总部地址:安徽合肥长江中路百大CBD中央广场14楼F座 开拓互联运营中心:安徽合肥市宿州路国轩大厦2501室
全国7X24H值班电话4006-8877-96 投诉QQ号:78721321 备案:皖ICP备07007666号