Re: Reading an Excel file using Jet.Oledb.4.0
- From: "Ralph" <nt_consulting64@xxxxxxxxx>
- Date: Wed, 8 Apr 2009 17:20:46 -0500
<mifaina@xxxxxxxxx> wrote in message
news:95642d93-9439-4471-a54f-4cee80872948@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Ralph:
Just wonder if you have any knowledge of the difference between
Jet.OLEDB.4.0 and Microsoft.ACE.OLEDB.12.0 regarding the errors codes.
I am trying to figure out a way to deal with various OLEDB errors and
there is a difference in the error code and message between these 2
providers. Any chance that you might have an idea where to get a list
of error codes? Thanks!
This is one for the " ... and I bet you thought you asked a simple question"
department.
Start here:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q168354&GSSNB=1
There are various HRESULT lists published here and there, at various sites
and within various documentation, and I could post a few URLs. But HRESULTS
and what they really mean for any particular product are like trying to find
the actual cost of a new car - only the dealer and god know for sure, or in
this case only god and perhaps a few developers.
For a "full" list you need to look at the various header files provided to
support COM (OLE is MS's implementation of COM). WinError.h, atldbcli.h,
etc., these headers are supplied with VC++ and a several SDK kits, because
that is where the original developer of a particular tool got them from.
[Note: These headers are copyrighted and seldom published.]
But that doesn't mean they will apply to all tools, or to all possible
scenarios. Consider that while using ADO and a Provider looks like a simple
client server call ...
Your Code -> ADO -> OLEDB Provider -> Database Engine
There is actually 8 to 12 steps, or layers, between here and there. At each
layer a component or routine may encounter an error - it has then two
choices (more perhaps, but to keep it simple ...); Stop what he's doing and
pass the error on or translate that error into something within the context
of what he was doing and pass on the new error. Keeping a consistent list of
ErrorCodes for a single project with mutliple developers is an
administrative problem. Keeping a consistent list over multiple projects is
even harder. Keeping a consistent list with mulitple projects that can be
used in multiple ways is an administrative nightmare.
That's why for apparently identical products - errors are often different.
(Also if you examine the "official" declarations for HRESULTS you'll
discover that many could easily be swapped - yet describe the same error.)
In practical use having a "full" list is NOT that helpful. I suggest the
following:
1) Consult the documentation
if still no go then ...
2) Use the published list MS (assuming your product is MS) provided above
if still no go then ...
3) Google for the error in MSDN, then the Web
if still no go then ...
4) Look up the error in one of headers and apply your Sherlock Holmes skills
There are several reasons for that order.
First off don't be surprised if a tool reports a particular error for a
specific condition, yet when you look up the "official" HRESULT in the COM
headers - it appears to be a bit of a stretch to apply that code.
Second, 90% of HRESULTS will the be common COM/OLE errors. Such a list is
readily available. Another 9% are COM/OLE errors but with slightly different
meanings within the context of a particular tool. They will only be
described in the product documentatin, if anywhere. And the last 1% are
often not even discovered until the tool has been out for awhile. (Pure
guessestimation on the statistics of course. lol)
hth
-ralph
.
- References:
- Re: Reading an Excel file using Jet.Oledb.4.0
- From: mifaina
- Re: Reading an Excel file using Jet.Oledb.4.0
- Prev by Date: Re: Reading an Excel file using Jet.Oledb.4.0
- Next by Date: SqlCommandBuilder creates invalid parameters
- Previous by thread: Re: Reading an Excel file using Jet.Oledb.4.0
- Next by thread: SqlCommandBuilder creates invalid parameters
- Index(es):
Relevant Pages
|
Loading