切换城市 [ 北京 武汉 ]24小时联系电话:
24小时联系电话: 010-62346005-808
切换城市 [ 北京 武汉 ]

有事点这里 有事点这里  有事点这里 有事点这里

如何连接ACCESS数据库?日期:2009/11/13 18:10:35  

本站整理出四种常用的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

>

网页设计

搜索引擎

设计理念

网站优化

咨询总机:010-62346005

地 址:北京市海淀区西三旗建材城东路2号1层101
武汉分公司地址:湖北省武汉市洪山区南国雄楚广场A4栋2011室
郑州分公司地址:河南郑州金水区东风路科技市场对面米兰阳光6号楼917室
邮 箱:haidanet@163.com
24小时联系电话: 15201609116 13651084380