温柔网

 找回密码
 注册

查看: 628|回复: 0

ASP连接Access数据库

[复制链接]
发表于 2004-1-14 18:45:12 | 显示全部楼层 |阅读模式

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=WD=;Database=customer





您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|温柔网 ( 浙ICP备13033583号-8 )

GMT+8, 2024-5-2 14:52 , Processed in 0.039804 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表