Getting more meaningful error messages from COM (ADO)

Posted on 2002-03-14
Last Modified: 2011-10-03
A number of applications I have use ADO, and it's great when everything works, but...

When you get an error like "OLE error 80030002" it can be hard to decipher what is going on.

There has to be a way of converting these meaningless hex error codes into something more insightful like "File not found".  (other than hardcoding each one)

Is there?

Look forward to your suggestions.

Note: In case there's not try comparing to the constants as specified in Windows.pas, such as ...

  { %l could not be found. }
Question by:Hamlet081299
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2

Expert Comment

ID: 6867620

Well, had this problem too a long time ago, apparently it seemed to be a bug in the Translation Resources at that time.  Setting my local settings to US English gave me the correct errors.

I'll look up what I exactly did, since i have written it down somewhere.

Further more there is a complete list on the Microsoft Website at the following URL :;EN-US;q168354

Best regards,


LVL 26

Expert Comment

by:Russell Libby
ID: 6867946


Have you tried passing the OLE error code to the SysErrorMessage() function? It calls the FormatMessage API, which will return the system defined error message description for both win32 error codes as well as OLE HResults.


Author Comment

ID: 6869739
Thanks for the suggestions so far...

The regional setting could be the issue.  Being in Australia, I like to have my dates around the "right" way, and also I like to be able to spell words like "colour" correctly.  ;-)

That list may come in handy too.

I will also look at SysErrorMessage.

I'll get back to you when I have had time to check these out (probably Monday).

Thanks again

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.


Author Comment

ID: 6875118
As Stefaan has suggested, it must be something to do with being unable to find or access the actual messages.

I tried the same code on two different machines.  One gives the meaningless "OLE error 80030002" whilst the other gives "%1 not found" ... still not perfect, but definitely better.

Do you know where it is trying to find the messages?  Is it possible I am just missing a file, or that it is in the wrong place?

Accepted Solution

Stefaan earned 100 total points
ID: 6876095

Well, can't remember completely what the issue was, but as far as I can remember it, it had something to do with the translation.  Setting the Regional Settings to US Englis solved the problem on my machine.

I will ask some colleagues of mine if they can remember what the actual problem was.

Best regards,


Author Comment

ID: 6876097
I tried setting to US English, but it didn't help.  I suspect that one of the messaging dll's is missing or corrupted on this machine, or is for some reason not being loaded.  I just can't work out which one.

Author Comment

ID: 6975907
I think it is just something missing on this machine.  The same code actually gives appropriate error messages on other machines.

I still have the problem, so if you have any insights as to what may be missing, I'd be glad to hear them.

In the meantime, you can have the points, as I have moved on and don't like to leave these questions sitting open.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Suggested Courses
Course of the Month6 days, 13 hours left to enroll

622 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