Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

Retrieve the error number from DBMS to VB ?

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
theankeong
Asked:
theankeong
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
What database objects are you using? ADO + ODBC driver?
Then check the connection's NativeError value...
0
 
DanRollinsCommented:
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
 
Computer101Commented:
Comment from expert accepted as answer

Computer101
E-E Admin
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now