Windows Server 2008,IIS7.5和与MS Access 97数据库的连接

时间:2022-05-20 05:08:05

I know, the topic sounds terrible. But I actually have to connect these technologies.

我知道,这个话题听起来很糟糕。但实际上我必须连接这些技术。

Problem

I am currently migrating company's intranet (written mostly in classic ASP) from Windows Server 2003 32 bit with IIS 6 to Windows Server 2008 R2 64 bit with IIS 7.5. Everything works perfectly fine except for one subpage which uses set conn = server.createobject("adodb.connection") to connect to connstring="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=path\to\mdb\which\is\really\there".

我目前正在将公司的Intranet(主要使用经典ASP编写)从IIS 6的Windows Server 2003 32位迁移到IIS 7.5的Windows Server 2008 R2 64位。除了一个使用set conn = server.createobject(“adodb.connection”)连接到connstring =“DRIVER = {Microsoft Access Driver(* .mdb)}; DBQ = path \ to \ mdb \”的子页面外,一切正常这\是\真的\那里”。

I open connection (conn.open connstring), build a query string and then, when I want to set rsresult = conn.execute(sqlusr) I get

我打开连接(conn.open connstring),构建一个查询字符串然后,当我想设置rsresult = conn.execute(sqlusr)我得到

Microsoft OLE DB Provider for ODBC Drivers error '80004005' 
[Microsoft][ODBC Microsoft Access Driver] ODBC--connection to 'TABLE_THAT_ACTUALLY_EXISTS' failed.

That error is thrown at the line with conn.execute(sqlusr). Of course, it worked fine in previous environment.

使用conn.execute(sqlusr)在该行引发该错误。当然,它在以前的环境中运行良好。

What have I tried?

  • connect to MS Access accdb file on Windows Server 2008 - I learned that Windows Server 2008 has MSJet preinstalled, so this question is of no use (reminder: mdb is for Access 97)
  • 连接到Windows Server 2008上的MS Access accdb文件 - 我了解到Windows Server 2008预安装了MSJet,所以这个问题没有用(提醒:mdb用于Access 97)
  • http://support.microsoft.com/kb/168336 - this is actually how the connection is made but I thought that sth may be wrong, misspelled, ...
  • http://support.microsoft.com/kb/168336 - 这实际上是连接的方式,但我认为这可能是错误的,拼写错误,......
  • I copied ODBC data sources form previous server to the new one (I kept the names) - problem still exists
  • 我将以前服务器上的ODBC数据源复制到新服务器(我保留了名称) - 问题仍然存在
  • I installed the latest updates on Windows Server 2008 machine
  • 我在Windows Server 2008计算机上安装了最新的更新

Additional info

  • mdb will open only in Access 97 (why? don't ask me : / I wasn't the only one who tried to open it in Access 2000/2003/2007/2010 - it worked nowhere)
  • mdb只能在Access 97中打开(为什么?不要问我:/我不是唯一一个试图在Access 2000/2003/2007/2010中打开它的人 - 它无处可去)
  • application pool for this web page on IIS 7.5 has Enable 32-bit Applications option set to true. Parent paths are also enabled.
  • IIS 7.5上此网页的应用程序池将“启用32位应用程序”选项设置为true。父路径也已启用。

I will be grateful for any additional tips on what to check/do/how to fix this issue.

如果有关于检查/操作/如何解决此问题的任何其他提示,我将不胜感激。

2 个解决方案

#1


1  

OK this is an interesting question.

好的,这是一个有趣的问题。

First - exists a documented problem using Classic ASP - IIS 7.x - ADODB.JET.4.0 you can see a guide to solve your problem

首先 - 使用经典ASP存在记录的问题 - IIS 7.x - ADODB.JET.4.0您可以看到解决问题的指南

Using Classic ASP with Microsoft Access Databases on IIS

在IIS上使用经典ASP与Microsoft Access数据库

Second - i strongly recommend you to not use the JET DRIVER anymore, instead use the ADODB.ACE.12.0 driver, while you can get the same functionality that you can obtain with the JET driver, also you get the advantage that the new Access file formats can be read and the driver can be implemented in a pure 64-bits enviroment

第二 - 我强烈建议你不再使用JET DRIVER,而是使用ADODB.ACE.12.0驱动程序,虽然你可以获得与JET驱动程序相同的功能,但你也可以获得新的Access文件的优势可以读取格式,驱动程序可以在纯64位环境中实现

ACEDB driver download (Microsoft)

ACEDB驱动下载(微软)

with this driver you can set the Enable 32-bit Applications to false

使用此驱动程序,您可以将启用32位应用程序设置为false

#2


-1  

OK, I solved my problem. I was able to import data and forms from Access 97 to Access 2010 really easily. Then I encountered some problems with asp and its connection to mdb. So I connected directly to the database. I still have to fix sql statement, but the main problem is resolved.

好的,我解决了我的问题。我能够非常轻松地将数据和表单从Access 97导入Access 2010。然后我遇到了一些asp及其与mdb的连接问题。所以我直接连接到数据库。我仍然需要修复sql语句,但主要问题是解决了。

Thanks!

谢谢!

#1


1  

OK this is an interesting question.

好的,这是一个有趣的问题。

First - exists a documented problem using Classic ASP - IIS 7.x - ADODB.JET.4.0 you can see a guide to solve your problem

首先 - 使用经典ASP存在记录的问题 - IIS 7.x - ADODB.JET.4.0您可以看到解决问题的指南

Using Classic ASP with Microsoft Access Databases on IIS

在IIS上使用经典ASP与Microsoft Access数据库

Second - i strongly recommend you to not use the JET DRIVER anymore, instead use the ADODB.ACE.12.0 driver, while you can get the same functionality that you can obtain with the JET driver, also you get the advantage that the new Access file formats can be read and the driver can be implemented in a pure 64-bits enviroment

第二 - 我强烈建议你不再使用JET DRIVER,而是使用ADODB.ACE.12.0驱动程序,虽然你可以获得与JET驱动程序相同的功能,但你也可以获得新的Access文件的优势可以读取格式,驱动程序可以在纯64位环境中实现

ACEDB driver download (Microsoft)

ACEDB驱动下载(微软)

with this driver you can set the Enable 32-bit Applications to false

使用此驱动程序,您可以将启用32位应用程序设置为false

#2


-1  

OK, I solved my problem. I was able to import data and forms from Access 97 to Access 2010 really easily. Then I encountered some problems with asp and its connection to mdb. So I connected directly to the database. I still have to fix sql statement, but the main problem is resolved.

好的,我解决了我的问题。我能够非常轻松地将数据和表单从Access 97导入Access 2010。然后我遇到了一些asp及其与mdb的连接问题。所以我直接连接到数据库。我仍然需要修复sql语句,但主要问题是解决了。

Thanks!

谢谢!