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. For years, it has worked fine when the SQL Server was on Win2008 Standard 64-bit SP2 and 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). 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.
My report is based on a pass-through query. The query runs almost instantaneously and produces 8000 rows. I can preview the query and quickly navigate to the end of the RS to see the 8000'th row. 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. I can even type in a page number and jump to page 50, 100, 150, etc. with no problem. 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.
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. I've tried adjusting the connect string to use IP address instead of DNS name, no luck. 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. 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. 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.
精彩评论