Odbc Error Message Access
Contents |
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 oracle odbc ora-01013 user requested cancel of current operation Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation
Ora-01013 Ms Access
Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like
Ora-01013 User Requested Cancel Of Current Operation (#1013)
you, helping each other. Join them; it only takes a minute: Sign up Can the “ODBC call failed” error message be trapped and presented as a friendlier error message? up vote 0 down vote favorite I have
Ora-01013 Timeout
a MS Access database with a linked table pointing to a SQL Server instance over ODBC. If I try to insert a row which violates a foreign key constraint, I get a fairly ugly error message: "ODBC--call failed" with further technical detail. Can I intercept this error message and present a friendlier explanation to the user? ms-access error-handling share|improve this question asked Oct 21 '14 at 21:08 jl6 1,58111643 add a comment| 1 Answer 1 active microsoft access odbc call failed ora-01013 oldest votes up vote 0 down vote You could put the error handling at Form level, like this: Private Sub Form_Error(DataErr As Integer, Response As Integer) Const conDuplicateKey = 3146 Dim strErrMsg As String Select Case DataErr Case conDuplicateKey: strErrMsg = "Record already exists in the database!" ' TODO: add other error codes Case Else Response = acDataErrDisplay End Select If strErrMsg <> vbNullString Then MsgBox strErrMsg, vbCritical, Me.Caption ActiveControl.Undo Response = acDataErrContinue End If End Sub share|improve this answer answered Oct 21 '14 at 23:26 mdialogo 1489 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged ms-access error-handling or ask your own question. asked 2 years ago viewed 180 times active 2 years ago Related 1Another ODBC Call Failed Topic0error with Warning: odbc_fetch_row(): 4 is not a valid ODBC result0Trap MSAccess Link Table Errors0MS Access VBA: Return to login form if login fails-1Acces add new rows2VBA Error in sql function call escapes error trap-1Trap Syntax Error During Compile0String-integer convert? Compiler Error Message: CS15021Why does my ODB
360 games PC games https://support.microsoft.com/en-us/kb/931407 Windows games Windows phone games Entertainment All Entertainment https://bytes.com/topic/access/answers/948681-how-trap-odbc-errors Movies & TV Music Business & Education Business Students & educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet user requested Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All user requested cancel Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
your question and get tips & solutions from a community of 418,605 IT Pros & Developers. It's quick & easy. How to trap for ODBC errors Expert 2.5K+ P: 2,778 Seth Schrock I have a database that its BE is SQL Server. Occasionally, I get ODBC errors, but they aren't going through my error trap. This is what I have right now: Expand|Select|Wrap|Line Numbers OnErrorGoToError_Handler 'Procedurecodehere... Exit_Procedure: ExitSub Error_Handler: CallErrorMessage(Err.Number,Err.Description,"ModuleName") ResumeExit_Procedure Resume The sub that gets called is: Expand|Select|Wrap|Line Numbers PublicSubErrorMessage(ErrorNumberasInteger,ErrorDescriptionasstring,_ Moduleasstring,OptionalCodeGroupasInteger=0) dimstrMsgasstring strMsg="Pleasecontactthedatabaseadministratorandprovidethefollowinginformation:"&_ vbCrLf&vbCrLf&_ "ErrorNumber:"&ErrorNumber&VbCrLf&_ "Description:"&ErrorDescription&VbCrLf&_ "Module:"&Module&VbCrLf&_ "CodeGroup:"&CodeGroup msgboxstrmsg,Buttons:=vbCritical,Title:="MyApplication" For some reason though, I'm still getting the normal ODBC error messages instead of my custom one. How do I get the error to go through my trap? Apr 11 '13 #1 Post Reply ✓ answered by ADezii You need to use the Errors collection to trap specific Open Database Connectivity (ODBC) Errors. Assuming you are using DAO: Expand|Select|Wrap|Line Numbers FunctionTestODBCErr() DimerrXAsDAO.Error OnErrorGoToODBCErrHandler 'FunctionCoding Exit_function: ExitFunction ODBCErrHandler: IfErrors.Count>1Then'ODBCrelated ForEacherrXInDAO.Errors Debug.Print"ODBCError" Debug.PrinterrX.Number Debug.PrinterrX.Description NexterrX Else'VBArelated Debug.Print"VBAError" Debug.PrintErr.Number Debug.PrintErr.Description EndIf ResumeExit_function EndFunction Share this Question 2 Replies Expert 5K+ P: 8,411 ADezii You need to use the Errors collection to trap specific Open Database Connectivity (ODBC) Errors. Assuming you are using DAO: Expand|Select|Wrap|Line Numbers FunctionTestODBCErr() DimerrXAsDAO.Error OnErrorGoToODBCErrHandler 'FunctionCoding Exit_function: ExitFunction ODBCErrHandler: IfErrors.Count>1Then'ODBCrelated ForEacherrXInDAO.Errors Debug.Print"ODBCError" Debug.PrinterrX.Number Debug.PrinterrX.Description NexterrX Else'VBArelated Debug.Print"VBAError" Debug.PrintErr.Number Debug.PrintErr.Description EndIf ResumeExit_function EndFunction Apr 11 '13 #2 reply Expert 2.5K+ P: 2,778 Seth Schrock Thanks ADe