Solved

Retrieve the error number from DBMS to VB ?

Posted on 2002-07-10
3
146 Views
Last Modified: 2012-05-04
Hi, I wanna ask on how do I retrieve the error number from a DBMS to my VB application.

For example, let say my recordset is trying to execute a select statement but the database does not have the table i want to access. Hence this will generate an error. My question is to retrieve the exact number of the error.

Note :The best I can get is with Err.Number but this just shows ODBC call failed regardless of specific error be it recordset, no connection others...

All I want is the exact error being reference by a number (eg: 123 may be for recordset error, 456 may be for error in connection to database)

This is important for me to handle error and rollback issues.
One more thing, my DBMS is Sybase SQL Anywhere

Thanks
Thean Keong
0
Comment
Question by:theankeong
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 7145455
What database objects are you using? ADO + ODBC driver?
Then check the connection's NativeError value...
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8002298
Hi theankeong,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept angelIII's comment(s) as an answer.

theankeong, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 8094142
Comment from expert accepted as answer

Computer101
E-E Admin
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now