什么是华大基因检查:我用dw做个人网站时,连接数据库发生以下错误,请问是怎么回事?

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/29 09:25:30
就是会出现以下提示:
[Microsoft][odbc驱动程序管理器]未发现数据源名称并且未指定默认驱动程序
事实上,我在odbc中已经这样设置了:打开—>系统DNS—>添加,可为什么到DW中数据库还是连接不起来

不用按向导设置,直接在ASP代码中加入。

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