首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

ASP 联接 ACCESS 数据库 4种方法

2012-10-21 
ASP 连接 ACCESS 数据库 4种方法1.set dbconnectionServer.CREATEOBJECT(ADODB.CONNECTION)DBPath Se

ASP 连接 ACCESS 数据库 4种方法

1.

set dbconnection=Server.CREATEOBJECT("ADODB.CONNECTION")

DBPath = Server.MapPath("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

set conn=server.createobject("Adodb.connection")

conn.open "DSN=xxx;UID=;PWD=;Database=customer?

热点排行