Anda di halaman 1dari 3

"> Diagnosing Error 3146 [ID 73336.

1] Modified 21-SEP-2010 Type BULLETIN Status PUBLISHED

PURPOSE A lot of ODBC Errors are reported to support as error 3146 which is a Microsoft Jet catch all error, this document will suggest what to do to identify the cause of the error. SCOPE & APPLICATION Intended for customers to assist support's diagnosis of the problem and for new analysts.

RELATED DOCUMENTS Microsoft Access On Line Help Microsoft ODBC SDK Programmers Reference Error 3146: ----------When someone is developing a Visual Basic Application using Data Access Objects (DAO), or is using Microsoft Access (MS-Access) they may receive the error: ODBC 3146 -- ODBC Call Failed. The documentation for this error can be found in the Microsoft Access On Line help and is part of the list of Trappable Microsoft Jet and DAO Errors as follows: "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 aren't connected to the network. Make sure the network is available, and then try the operation again." This is not the world's most helpful error or message. What it really indicates is that an error occurred when accessing data from an ODBC datasource. If the error is occurring in a VB application, then you can traverse the error stack to find the underlying database error. Otehrwise you will need to use the ODBC trace facility to identify the error.

Traversing the Errors Collection --------------------------------When a DAO error occurs, the full error stack is loaded into the errors collection and this can be printed out when an error occurs. Firstly: code an On Error statement so that a block of code can be executed when an error condition occurs. .. On Error GoTo errorhandler .. If this is not done then the error will appear in a default dialog as

Run-time Error 3146:

ODBC Call Failed errorhandler is the name of a section that you want to execute coded like the code below: errorhandler: Message = "Action Failed -" & Err.Number & " " & Err.Description Do Until count = Errors.count Message = Message & Errors(count).Description count = count + 1 Loop MsgBox (Message) This Changes the error reported to something like: Action Failed -3146 ODBC--call failed. [Oracle][ODBC][Ora]ORA-00904: invalid column name ODBC--call failed Using ODBC Trace ----------------The ODBC Trace utility, provided as part of the ODBC administration software is a very useful tool for diagnosing problems. Although verbose, it is not as verbose as the sql*net trace utility which could be used for the same purpose. To turn on the ODBC trace utility, load the ODBC administrator either from the Control Panel or the Start->Programs->Oracle For Windows XX menu Select the Tracing Tab Enter a filename - e.g. c:\temp\odbclog.log Click the 'Start Tracing Now' button. The statement you are looking for in the file produced is something like the lines indicated below. Bear in mind that the Jet Database engine does a lot of investigation of the ODBC driver before statements are executed so the error you are looking for is likely to be quite a way inside the code. A good technique is to reproduce the error and immediately exit from the application and then search the log file from the end backwards.

VB6

12e:10d ENTER SQLExecDirect HSTMT 0x088024a8 UCHAR * 0x0019c6d0 [ SDWORD -3 12e:10d EXIT HSTMT UCHAR * SDWORD

-3] "select ename,emno from emp\ 0"

VB6

SQLExecDirect with return code -1 (SQL_ERROR) 0x088024a8 0x0019c6d0 [ -3] "select ename,emno from emp\ 0" -3

DIAG [S0022] [Oracle][ODBC][Ora]ORA-00904: invalid column name (904)

Related Products

Oracle Database Products > Oracle Database > Platform specific utilities > Oracle ODBC Driver Keywords MICROSOFT; ACTION FAILED; TRACE; ODBC DRIVER; ODBC; RETURN CODE; ERROR CONDITION

Errors ORA-904; ERROR 3146

Back to top Copyright (c) 2007, 2010, Oracle. All rights reserved. Legal Notices and Terms of Use | Privacy Statement

Anda mungkin juga menyukai