OLE DB error occured. Code 80040E2Fh

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
peetjet
Posts: 8
Joined: Fri 04 Mar 2005 10:45
Location: Netherlands
Contact:

OLE DB error occured. Code 80040E2Fh

Post by peetjet » Thu 30 Mar 2006 15:17

Allthough I try to avoid it, I sometimes get this message when testing/debugging my programs: "EOLEDBError: OLE DB error occured. Code 80040E2Fh"
Is it possible to retrieve more information than this?
If so: how?

What I do now is:
- catch the exception
- write error-message, sql-statement and parameter/field-values to a text-file.
- Edit the saved SQL-statement so it containes the literal values.
- Execute the statement in SQL Server's query analyzer
- Then I get a more meaningful message

What I would like is to retreive the more meaningful message directly in my programs.
Version info: Delphi 7.0, SDAC 3.50

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Fri 31 Mar 2006 08:53

Situation when OLE DB doesn't generate error description may occur when
connection initialized in one thread and used in another one, or when connection
pooling is used in multithread application.

peetjet
Posts: 8
Joined: Fri 04 Mar 2005 10:45
Location: Netherlands
Contact:

Post by peetjet » Fri 31 Mar 2006 12:04

Thanks, this seems to bee helpful.
I moved the connection creation from the main thead to the thread that uses the DBConnection but now I run into another error: StartTransaction raises an exception in combination with TMSQuery.fetchall = False.
I can work around this, but maybe this is something to fix in a future release?
But thanks again for your quick reply.

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Fri 31 Mar 2006 13:38

When setting TCustomMSDataSet.FetchAll = False you should keep in mind that execution of such queries blocks current session. In order to avoid blocking OLE DB creates additional session which causes following problem:
· Each additional session runs outside of the transaction context, thus TMSConnection.Commit and TMSConnection.Rollback operations in main session won't apply changes made in additional sessions. This also concerns changes made by TDataSet.Post.

Post Reply