Access Error 3151
Contents |
soon) Ruby (coming soon) Getting Started Code Samples Resources Patterns and Practices App Registration Tool Events Podcasts Training API Sandbox Videos Documentation Office Add-ins Office Add-in Availability Office Add-ins Changelog Microsoft Graph API Office 365 Connectors Office 365 access error 3151 odbc connection to failed REST APIs SharePoint Add-ins Office UI Fabric Submit to the Office Store All Documentation access error 2950 https://www.yammer.com/ http://feeds.feedburner.com/office/fmNx Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Asked by: error 3151 odbc connection failed ms access ODBC Call Failed - Error 3151 Microsoft Office for Developers > Access for Developers Question 0 Sign in to vote We have an Access database migrated from Access 97 to Acces 2007 with some linked tables
Error 3151 Odbc Connection Failed Windows 7
to an SQL Server 2008 database. We are using a File DSN in the ODBC Administrator. Connection tests work fine there. In fact, we have a main form in the Access 2007 application that shows the data always correctly. The problem appears when we execute a task that makes the following call: Dim dbs As Database Dim rstAppend As Recordset Set dbs = CurrentDb Set rstAppend = dbs.OpenRecordset(strAccessTable, dbOpenDynaset, dbSeeChanges) OpenRecordset throws runtime error 3151 the error number 3151 and occurs randomly but it appears quite frequently. It's sporadic. When we don't get the error, the task works fine. It not happens always, mosty we're fine. When it happens it happens for all subsequent tasks tried. We have to close and reopen the Access database and pray to the good Lord that it works. here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with run-time error 3151 us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ODBC Connection Failed #3151 MS Access --> SQL Server 2008 up vote 1 down vote favorite 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 https://social.msdn.microsoft.com/Forums/office/en-US/dc8b91f0-d176-4ccb-9282-134fa17a2e9e/odbc-call-failed-error-3151?forum=accessdev 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 http://stackoverflow.com/questions/5583256/odbc-connection-failed-3151-ms-access-sql-server-2008 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? sql-server ms-access odbc share|improve this question edited Apr 7 '11 at 15:11 Tony Toews 7,02511324 asked Apr 7 '11 at 15:04 lunchroom 6112 Is there anything in the SQL Errorlog? What about the Event Logs? (Server side and Cl Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools Rating: Display Modes 01-29-2013, 04:09 http://www.access-programmers.co.uk/forums/showthread.php?t=240995 AM #1 Insane_ai Newly Registered User Join Date: Mar 2009 Location: Cleveland, OH USA Posts: 161 Thanks: 1 Thanked 14 Times in 11 Posts Oracle ODBC Connection Error 3151 The following code works when employed on Windows XP clients. I am upgrading to Windows 7 Professional 64 bit. I have verified the ODBC connection is working properly through the ODBC management. I get Error 3151 Private Sub Form_Load() Dim DB error 3151 As DAO.Database Dim TDF As DAO.TableDef 'Refresh Databse Link Set DB = CurrentDb() Set TDF = DB.TableDefs("EWVPD_PRODUCT") TDF.Connect = "ODBC;DSN=[DSN_NAME];UID=[USER];PWD=[Password]" TDF.RefreshLink DoCmd.OpenForm "Main", acNormal DoCmd.Close acForm, Me.Name End Sub Error Message: Run-time error '3151' ODBC connection to '[DSN_NAME] failed The code in RED is being flagged for the error. The file's location is in the trusted locations via registry edits. The idea of this code is to make a connection to the Oracle error 3151 odbc database in the background when the application opens to avoid password issues. Any advice on the configuration or re-coding of this is greatly appreciated. I suspect I will have to add code to compare the host operating system so I use the proper method depending on the client using the application. __________________ There's nothing like trouble shooting to find out how much I have yet to learn. Last edited by Insane_ai; 01-29-2013 at 04:38 AM. Reason: spelling error(s) Insane_ai View Public Profile Find More Posts by Insane_ai 01-29-2013, 04:38 AM #2 mdlueck Sr. Application Developer Join Date: Jun 2011 Posts: 2,584 Thanks: 110 Thanked 293 Times in 282 Posts Re: Oracle ODBC Connection Error 3151 Quote: Originally Posted by Insane_ai The following code works when employed on Windows XP clients. I am upgrading to Windows 7 Professional 64 bit You should specify what version of Access you had the application working properly with on Windows XP, and what version (including compiled architecture) you are attempting to use on Windows 7. __________________ -- Michael Lueck Lueck Data Systems To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. mdlueck View Public Profile Visit mdlueck's homepage! Find More Posts by mdlueck Runtime Error 3151 Odbc Connection Failed Access 2010
Run Time Error 3151 Odbc Connection Failed Oracle