Odbc Call Failed Error 3146 Access 2007
Contents |
be down. Please try the request again. Your cache administrator is webmaster. Generated Sat, 22 Oct 2016 05:58:42 GMT by s_wx1085 (squid/3.5.20)
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 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 like you, helping each other. Join them; it only takes a minute: Sign up Determine real http://answers.microsoft.com/en-us/msoffice/forum/msoffice_access-mso_other/access-2007-odbc-call-failed-error-3146-only-on/27172fb8-958f-4222-be8e-9083541c8891 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 when running some reports. From what I can tell, this is just a generic ODBC call failed error. I've tried sticking some error http://stackoverflow.com/questions/730414/determine-real-cause-of-odbc-failure-error-3146-with-ms-access 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 open for suggestions on how to diagnose this. vba ms-access vbscript odbc share|improve this question edited Jun 16 '14 at 20:23 Smandoli 5,01322863 asked Apr 8 '09 at 14:57 Aaron Hinni 11k43134 add a comment| 2 Answers 2 active oldest votes up vote 5 down vote Use th
2002. The following code segment executes the first read, from rs, successfully, but gives me a "Run-time error 3146 ODBC--call failed" on the second one from rs1. Both rs and http://www.pcreview.co.uk/threads/run-time-error-3146-odbc-call-failed.1865044/ rs1 are queries. Can anyone give me information on this error? Dim db as Database Dim rs as Recordset Dim rs1 as Recordset Dim strUserID as String Dim strProgram as String Set db = CurrentDb Set http://www.vbforums.com/showthread.php?468934-ODBC-%96-call-failed-(Error-3146) rs = db.OpenRecordset("SELECT program_id FROM sysuser WHERE sysuser_id = '" & strUserID & "'", dbOpenDynaset) rs.MoveFirst strProgram = rs!program_id If Right(strStartLoc, 2) = "10" Then Set rs1 = db.OpenRecordset("SELECT * FROM report_db WHERE enabled = error 3146 '" & strUserID & "'", dbOpenDynaset) .... End If -- Carol Guest, Jun 9, 2005 #1 Advertisements Guest Guest Try and run the queries, see if you get this error message. Running the query, not by code, will give you the odbc call failed, and then it will give another message, of what is the real error. If the query will run, then run the code, put a break odbc call failed before the open recordset, copy the string of the SQL to the immidiate window ?"SELECT program_id FROM sysuser WHERE sysuser_id = '" & strUserID & "'" and copy it to a new query and run, it will give you the real error. And as a side note 1. try and run the tables, mybe you are not connected to the server 2. Is user id is text type, if not then the sql should look like "SELECT program_id FROM sysuser WHERE sysuser_id = " & strUserID "Carol Grismore" wrote: > I am using Access 2002. The following code segment executes the first read, > from rs, successfully, but gives me a "Run-time error 3146 ODBC--call > failed" on the second one from rs1. Both rs and rs1 are queries. Can anyone > give me information on this error? > > Dim db as Database > Dim rs as Recordset > Dim rs1 as Recordset > Dim strUserID as String > Dim strProgram as String > > Set db = CurrentDb > Set rs = db.OpenRecordset("SELECT program_id FROM sysuser WHERE sysuser_id = > '" & strUserID & "'", dbOpenDynaset) > > rs.MoveFirst > strProgram = rs!program_id > > If Right(strStartLoc, 2) = "10" Then > Set rs1 = db.OpenRecordset("SELECT *
this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 7 of 7 Thread: ODBC – call failed. (Error 3146) Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode May 15th, 2007,02:22 AM #1 Champinco View Profile View Forum Posts Thread Starter Member Join Date Nov 2006 Posts 55 ODBC – call failed. (Error 3146) Hi Guys, I have an application and in particular an append query that inserts rows into a linked table. I keep on getting this error, (although the code works fine in enterprise manager, and code-imports ok). I did not cancel the query but it seems to think it has. The insert/append query starts and prompts me for the username and password, this works fine, it just stops half way or beggining etc... This is the error: ORA-01013: User requested cancel of current operation (#1013) And this is the error on Help file: ODBC – call failed. (Error 3146) Using an ODBC connection, you tried to perform an operation on data in an ODBC data source. This error may occur when the ODBC data source is on a network drive and you are not connected to the network. Make sure the network is available, and then try the operation again. Cheers Champinco Im using VB 6.3, Microsoft Access 2003 Reply With Quote May 15th, 2007,03:44 AM #2 Ecniv View Profile View Forum Posts Visit Homepage Don't Panic! Join Date Nov 2000 Location Excel Hell! Posts 5,048 Re: ODBC – call failed. (Error 3146) Reads like the path to the data (mdb?) is different and cannot be located? BOFH Now, BOFH Past, Information on duplicates Feeling like a fly on the inside of a closed window (Thunk!) If I post a lot, it is because I am bored at work! ;D Or stuck... * Anything I post can be only my opinion. Advice etc is up to you to persue... Reply With Quote May 15th, 2007,06:02 PM #3 Champinco View Profile View Forum Posts Thread Starter Member Join Date Nov 2006 Posts 55 Re: ODBC – call failed. (Error 3146) Sorry Im not sure what you mean? as the thread indicates, it runs the query but stops half way and gives me the error message. Im using VB 6.3, Microsoft Access 2003 Reply With Quote May 15th, 2007,06:39 PM #4 Hack View Profile View F