Page 1 of 1

OLE DB Error and Field not found problems

Posted: Thu 01 Aug 2013 10:33
by Kire
We have one customer where we have strange problems with the database connection.

After a while we do get an 'OLE DB error occured. Code 80040E21h', this happens while posting a record in a table.

Instead of this problem we also get a message that a field is not found: 'Field BAS_SYSNR not found'. It is not always the same field and not the same table. Checked the structures of the databse at the customer and it seems perfectly correct.

Yet we cannot reproduce these problems on our own pc.

Hope someone can point me in the right direction.

Regards,
Erik

Re: OLE DB Error and Field not found problems

Posted: Fri 02 Aug 2013 09:29
by AndreyZ
OLE DB error occured. Code 80040E21h
This problem may be caused by the particular SQL Server client version your customer uses. Please make sure your customer uses the same SQL Server client (Native Client 11, Native Client 10, Native Client 9, OLEDB) version as you do.
Field BAS_SYSNR not found
This message means that there is no such field either on the server or on the client.

In order to give a more valid answer, we need the test project that demonstrates these problems. If you are able to create such project and send it to us, we will gladly investigate it.

Re: OLE DB Error and Field not found problems

Posted: Tue 06 Aug 2013 10:25
by Kire
Some more investigation showed that we probably have a thread issue that never caused problems (or at least never came to the surface) in the BDE version and is now giving problems using SDAC.

The point is we have a webservice in the application that uses the THTTPRIO class. The database layer (TMSTable etc) is openend in the main thread, however the calls getting in from the webservice are in their own thread. I suppose accessing the database layer from that thread directly is prohibited? And doing that might result in different errors like the ones mentioned?

Now I'm looking for an easy way to sync these threads regarding the database calls?

I hope you can confirm my suspicion regarding the threads and hopefully some ideas to fix this.

Regards,
Erik

Re: OLE DB Error and Field not found problems

Posted: Wed 07 Aug 2013 06:48
by AndreyZ
SDAC is thread-safe, but the restriction is that you cannot use one connection (the TMSConnection component) in several threads, you must have connections in each thread. Please check that you have connection in each thread.

Re: OLE DB Error and Field not found problems

Posted: Wed 07 Aug 2013 07:12
by Kire
Ah, ok.

I already changed part of the code so that the call from the webservice is synchronized with the main thread and all problems seem to be gone now. I guess the original code was in fact also not quite 100% ok for BDE but seemed to be causing no real problems there.

Funny how one find development mistakes after all these years by switching to different components :mrgreen:

Thanx for the help !

Regards,
Erik

Re: OLE DB Error and Field not found problems

Posted: Wed 07 Aug 2013 07:35
by AndreyZ
I am glad I could help. Feel free to contact us if you have any further questions about SDAC.