简体   繁体   English

ODBC连接失败#3151 MS Access-> SQL Server 2008

[英]ODBC Connection Failed #3151 MS Access --> SQL Server 2008

I have an MS Access application that links to a SQL Server 2008 db for all of its data. 我有一个MS Access应用程序,该应用程序链接到SQL Server 2008数据库的所有数据。 For years, it has worked fine when the SQL Server was on Win2008 Standard 64-bit SP2 and SQL Server 2008 v10.0.4. 多年来,当将SQL Server安装在Win2008 Standard 64位SP2和SQL Server 2008 v10.0.4上时,它运行良好。 I recently moved the back-end SQL db to a newer server (Win2008 R2 Standard 64-bit and SQL v10.50.1600). 我最近将后端SQL数据库移到了较新的服务器(Win2008 R2 Standard 64位和SQL v10.50.1600)。 After the move, everything on the application worked just fine as expected, no issues. 移动之后,应用程序上的所有内容均按预期正常运行,没有问题。 However, we have a month-end process that generates relatively large reports (300-500 pages) which uncovered an issue that we don't normally see in our day-to-day processing. 但是,我们有一个月末流程,会生成相对较大的报告(300-500页),发现了我们在日常处理中通常看不到的问题。

My report is based on a pass-through query. 我的报告基于传递查询。 The query runs almost instantaneously and produces 8000 rows. 查询几乎立即运行,并产生8000行。 I can preview the query and quickly navigate to the end of the RS to see the 8000'th row. 我可以预览查询并快速导航到RS的末尾以查看第8000行。 No problem. 没问题。 If I pull up the report that's based on that query, I can see that there are 350 pages and I can navigate page-by-page through the report with no problem. 如果我拉出基于该查询的报告,则可以看到有350页,并且可以毫无问题地逐页浏览该报告。 I can even type in a page number and jump to page 50, 100, 150, etc. with no problem. 我什至可以输入页码并毫无问题地跳到第50、100、150等页。 Note, there is no processing/code/logic happening on any fired events on the report - just displaying and formatting the data. 请注意,报表上的任何激发事件都不会发生处理/代码/逻辑-只是显示和格式化数据。

HERE IS WHERE THE PROBLEM OCCURS: If I preview the report and try to jump to the last page from the first page, it'll sit and think for a while (38 seconds to be exact) and then throw Error #3151 ODBC Connection to [DNS Name] Failed. 这里是发生问题的地方:如果我预览报告并尝试从第一页跳到最后一页,它将坐下来思考一会儿(准确地说是38秒),然后将错误#3151 ODBC连接到[DNS名称]失败。

If I simply update the connect string on the pass-through query to point it back to the "older" SQL Server and run the same thing, it works just fine. 如果我只是简单地更新传递查询上的连接字符串,使其指向“较旧的” SQL Server并运行相同的内容,那么它将正常工作。 I've tried adjusting the connect string to use IP address instead of DNS name, no luck. 我尝试过调整连接字符串以使用IP地址而不是DNS名称,但是不走运。 This is a process that's worked for years with no problem so I know the client-side logic is sound. 这个过程已经工作了多年,没有问题,所以我知道客户端逻辑是合理的。

Any thoughts or suggestions? 有什么想法或建议吗?

OK, this is an entirely shoddy solution and not really safe with multiple people running it on the same DB or Access file... but it might get you running today and give you some breathing room. 好的,这是一个完全伪劣的解决方案,如果多个人在同一个DB或Access文件上运行该解决方案并不是很安全...但是它可能会让您今天运行起来,并给您带来喘息的机会。 But remember - Broken gets fixed, shoddy lasts forever. 但请记住-破碎变得固定,次充好将永远持续。

Take the query from the report, and before you run it, dump the results into an empty temporary table (either on the MS SQL side, or the MS Access side) and then make the report run off of the temporary table instead. 从报表中获取查询,然后在运行查询之前,将结果转储到空的临时表中(在MS SQL端或MS Access端),然后使报告从临时表中运行。 Remember to clean it out afterwards so no-one relies on that data for anything. 请记住,事后要清理它,以确保没有人依赖于该数据。

If it works on the MS Access side, but not on the MS SQL side, then that'll confirm there is something with the new server's configuration. 如果它在MS Access端有效,但在MS SQL端无效,那么这将确认新服务器的配置是否存在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM