Microsoft Visual Basic Error 3146
Contents |
SQL Server 2014 Express resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation
Run Time Error 3146 Odbc Call Failed Access
APIs and reference Dev centers Samples Retired content We’re sorry. The content run time error 3146 odbc call failed access 2010 you requested has been removed. You’ll be auto redirected in 1 second. Ask a question Quick access Forums
Run Time Error 3146 Odbc Call Failed Oracle
home Browse forums users FAQ Search related threads Remove From My Forums Answered by: VBA Excel/Oracle query and run-time error 3146 Microsoft ISV Community Center > Visual Basic for Applications access vba runtime error 3146 (VBA) Question 0 Sign in to vote Hello, I have a small VBA Excel app that queries an Oracle database. Certain tables I hit are quite large, and queries on these large tables (with their associated large datasets) cause the following error: "Run-time error 3146" "ODBC call failed" Googling leads me to believe that this is some sort of timeout run time error 3146 odbc call failed mysql problem. Here is the code I use (in part, all variables are appropriately dim'd): [code] strSQL = strSelect & strFrom & strWhere & strAnd & strMachines & strGroupBySet qdfData = dbMyDB.CreateQueryDef("", strSQL)strMyServer = "myserver" & ";"strDBConn = "ODBC;DRIVER={Oracle in OraHome92};SERVER=" & strMyServerqdfData.Connect = strDBConn & "UID=user_id;DBQ=" & strMyServer & "pwd=password;" [/code] I don't have a problem with queries of small tables, only the large ones. I read that it's possible to set connection.timeout = 0 to avoid this error, but I am VERY new to VBA and don't know how to incorporate that into this code. Any help is appreciated. Tuesday, March 21, 2006 5:50 PM Reply | Quote Answers 0 Sign in to vote Per our support engineer: I understand that you want to set timeout when executing the SQL command. Generally I would suggest using ADO. The code you post in the forum is somewhat like DAO. ADO is newer technology than DAO. In ADO, you can control timeout by using ConnectionTimeout or CommandTimeout property. Using ADOHow-to: Connecting to Oracle from VBAhttp://www.marcel-jan.nl/oracle/tips/oracle_tip_vba.html Accessing Data with ADOhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help
Error 3146 Odbc Call Failed Sql
Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor odbc call failed access 2013 Services Groups Website Testing Store Headlines Experts Exchange > Questions > MS Access (VB) Runtime error 3146 ODBC Call Failed (connecting to mySQL) Want to Advertise Here? Solved MS Access (VB) Runtime error 3146 ODBC Call Failed (connecting to mySQL) Posted on 2012-08-16 MS Access MySQL Server 1 Verified Solution 2 Comments 7,789 Views Last Modified: 2012-08-23 https://social.msdn.microsoft.com/Forums/en-US/75333327-1e1a-4af3-95b9-045b7de732eb/vba-exceloracle-query-and-runtime-error-3146?forum=isvvba Hi Experts I have recently had to update mySQL from 5.1 to 5.5 with a MS Access 2003 front end (via ODBC links) When I run some legacy SQL queries on Access using a form I inherited (and worked fine before the rebuild) I am getting Visual Basic Error 3146 ODBC Call Failed. I can run the code directly within mySQL so I am at a loss what the problem might be. https://www.experts-exchange.com/questions/27831438/MS-Access-VB-Runtime-error-3146-ODBC-Call-Failed-connecting-to-mySQL.html I have switched ODBC Tracing on, and get the following fragment in the log - which doesnt really help much: InterconnecTRep 90-14f0 EXIT SQLExecDirect with return code -1 (SQL_ERROR) HSTMT 0FA83860 UCHAR * 0x11CF44B4 [ 2010] "## This report currently includes ...(SQL is in here)" SDWORD 2010 DIAG [S1000] [MySQL][ODBC 5.1 Driver][mysqld-5.5.27-log]Query execution was interrupted (1317) Does anyone know how I can force more detail on the 3146 error, so it shows me what the *real* problem is? Thanks 0 Question by:stummj Facebook Twitter LinkedIn Google LVL 56 Active today Best Solution byJim Dettman (Microsoft MVP/ EE MVE) <
here for a quick overview of the site Help Center Detailed answers to any questions you might have http://stackoverflow.com/questions/730414/determine-real-cause-of-odbc-failure-error-3146-with-ms-access 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 https://bytes.com/topic/access/answers/206736-odbc-call-error-3146-a us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just error 3146 like you, helping each other. Join them; it only takes a minute: Sign up Determine real cause of ODBC failure (error 3146) with ms-access? up vote 6 down vote favorite 2 My client is using Access as a front end to a SQL Server database. They recently started getting ODBC - 3146 errors from time to time odbc call failed when running some reports. From what I can tell, this is just a generic ODBC call failed error. I've tried sticking some error handling in the VB script that is launching the reports, but I am not having any luck getting extra error information. Code looks a bit like this. Public Function RunReports() On Error GoTo MyErrorTrap DoCmd.OpenReport "blah", acViewPreview DoCmd.Close DoCmd.OpenReport "foo", acViewPreview DoCmd.Close Exit_function: Exit Function MyErrorTrap: Dim errX As DAO.Error Dim MyError As Error If Errors.Count > 1 'This always seems to be 0, so no help For Each errX In DAO.Errors 'These are empty even if dont check for Errors.Count Debug.Print "ODBC Error" Debug.Print errX.Number Debug.Print errX.Description Next errX Else Debug.Print "VBA Error" Debug.Print Err.Number Debug.Print Err.Description End If 'Also have tried checking DBEngine.Errors, but this is empty too End Function I've also enabled tracing on the ODBC side, but that has bogged things down way too much, and I am so far unable to recreate the ODBC error. I am completely op
question and get tips & solutions from a community of 418,590 IT Pros & Developers. It's quick & easy. ODBC Call error 3146 P: n/a Jimbo I have an access 97 database linked to sql server..I click update on a form and get an error message: Run-time error 3146 ODBC call failed The debugger points to this line: MyTable.Update In this segment of code: Private Sub Update5_Click() Dim MyDB As Database, MyTable As Recordset, MyTmpTable As Recordset, Criteria As String, NewID As Long Set MyDB = DBEngine.Workspaces(0).Databases(0) Set MyTable = MyDB.OpenRecordset("Dx5", DB_OPEN_DYNASET, dbSeeChanges) Set MyTmpTable = MyDB.OpenRecordset("tmp_RockDx5", DB_OPEN_DYNASET) MyTable.AddNew MyTable.Update MyTable.Move 0, MyTable.LastModified NewID = MyTable![Dx5ID] Me![HoldNewDxID] = NewID If DCount("*", "Dx5Current") > 0 Then Me![HoldOldDxID] = Me![Dx5Current].Form![Dx5ID] 'Put end date on the current Axis 5 'record Me![Dx5Current].Form![EndDate] = Date DoCmd.DoMenuItem A_FORMBAR, A_FILE, A_SAVERECORD 'Copy in data from the current Axis 5 'record to the new record, since it is 'likely to be similar Set MyTable = MyDB.OpenRecordset("Dx5", DB_OPEN_DYNASET) holdnum = Forms![DxSummary]![HoldNewDxID] Criteria = "[Dx5ID] = " & holdnum MyTable.FindFirst Criteria MyTable.Edit MyTable![CurrentGAF] = Me![Dx5Current].Form![CurrentGAF] MyTable![HighestGAFLastYear] = Me![Dx5Current].Form![HighestGAFLastYear] MyTable.Update End If Me.Visible = False Me![Dx5Current].Requery 'This is necessary in order to release the 'record, so that it can be edited if the 'user uses the Cancel button on the add-edit 'form Criteria = "[Dx5ID] = Forms![DxSummary]![HoldNewDxID]" DoCmd.OpenForm "AddDx5", , , Criteria, A_EDIT MyTmpTable.Close MyTable.Close Forms![AddDx5]![ClientID] = Forms![LogIn]![ActiveClient] Forms![AddDx5]![StaffID] = Forms![LogIn]![ActiveStaff] End Sub Nov 13 '05 #1 Post Reply Share this Question 2 Replies P: n/a Steve Jorgensen Since you are getting an ODBC error, I assume you're using linked tables. The ODBC call failed error is the same for -any- server-side failure, and is not terribly informative. To get the useful error information in these cases, you must examine the Errors collection. Looking at what you're doing, though, I'm guessing the table has one or more required fields with no default values, so doing an Update immediately after an AddNew is trying to create a new record without the minimum required field data. On 29 Mar 2005 07:00:05 -0800, "Jimbo"