连接到使用ADODB对象在传统的ASP Access数据库 [英] Connecting to an Access database in Classic ASP using an ADODB object

查看:282
本文介绍了连接到使用ADODB对象在传统的ASP Access数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的传统的ASP。我宁愿问的问题不是做研究的时间来解决我的问题。

我访问Access数据库并得到以下错误。

  Microsoft OLE DB提供的ODBC驱动程序错误80004005
[微软] [ODBC驱动程序管理器]数据源名称未找到和指定默认驱动程序
/default1.asp 30行

罪魁祸首线是这个

 设置的myconn =的Server.CreateObject(ADODB.Connection)
MdbFilePath =使用Server.Mappath(C:\\数据库\\了MyDatabase.mdb)


  1. 好吧,我不已经安装了访问,但我复制.mdb文件到指定的文件夹,将它的工作呀?我熟悉的SQL Server,而且具有以检索它的数据运行。


  2. 它利用ADODB,但我无法归档的DLL。有人可以为我的DLL。我有什么做的就是它的工作。只需注册,将工作使用 REGSVR32 my.dll


  3. 我无法找到一个连接字符串(我通常使用一个连接字符串连接到我的SQL Server)。难道我在这种情况下,需要一个Access数据库?


请帮忙


解决方案

这是一个几年我,所以这个答案可能有点过时了。此外,由于Access数据库中的.mdb结束,我假定这是一个pre-2007的数据库。

是的,只要该文件应该工作。访问并不需要运行,它只是需要读取的文件。但是,您可能需要安装交谈的Access数据库的某些组件(以前是MDAC
  - http://www.microsoft.com/download/en/details。 ASPX?ID = 1953年,不是100%肯定,如果它仍然是)。 MDAC包含Jet引擎,传统的ASP使用交谈访问文件。

至于连接字符串,这个网站提供接入的连接字符串的一些例子: http://connectionstrings.com/访问

修改 - 增加更多的信息

万一我没有正确遵循的意见,这里有一个如何通过经典ASP连接Access数据库的例子:

 设置的myconn =的Server.CreateObject(ADODB.Connection)
MdbFilePath =C:\\数据库\\了MyDatabase.mdb''不需要使用Server.Mappath#,因为我们已经提供了整个路径
MyConn.Open供应商= Microsoft.Jet.OLEDB.4.0;数据源=&放大器; MdbFilePath

在运行上述code,你收到错误依然?此外,有什么设置你正在运行(IIS7,IIS6,32位,64位)?

I am new to classic ASP. I would rather ask question than do hour of research to solve my problem.

I am accessing access database and getting the following error.

Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified    
/default1.asp, line 30

The culprit line is this

Set MyConn = Server.CreateObject("ADODB.Connection")
MdbFilePath = Server.MapPath("c:\database\MyDatabase.mdb") 

  1. Well, I do not have Access installed but I copied the .mdb file to the specified folder, will it work that way? I am familiar with SQL Server, and that has to run in order to retrieve data from it.

  2. It uses ADODB but I can't file the DLL. Can someone specify the DLL for me. What I have to do to get it working. Just registering it will work using regsvr32 my.dll?

  3. I could not find a connection string (I usually use a connection string to connect to my SQL Server). Do I need one for Access database in this case?

Please help

解决方案

It's been a few years for me, so this answer might be a little out of date. Also, since the Access db ends in .mdb, I'm assuming that it's a pre-2007 database.

Yes, just the file should work. Access does not need to run, it just needs to read the file. However, you may need certain components installed to talk to the Access database (used to be MDAC - http://www.microsoft.com/download/en/details.aspx?id=1953, not 100% certain if it still is). MDAC contains the JET engine, which classic ASP uses to talk to Access files.

As for the connection string, this web site that provides some examples of access connection strings: http://connectionstrings.com/access

edit - adding more info

Just in case I'm not following the comments correctly, here's an example of how to connect to the Access database through Classic ASP:

Set MyConn = Server.CreateObject("ADODB.Connection")
MdbFilePath = "c:\database\MyDatabase.mdb" ''# Server.MapPath is not needed, since we are providing the whole path already
MyConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & MdbFilePath

When running the code above, do you receive the error still? Also, what's the set up you're running (IIS7, IIS6, 32bit, 64bit)?

这篇关于连接到使用ADODB对象在传统的ASP Access数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆