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
OLE DB Error and Field not found problems
-
AndreyZ
Re: OLE DB Error and Field not found problems
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.OLE DB error occured. Code 80040E21h
This message means that there is no such field either on the server or on the client.Field BAS_SYSNR not found
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
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
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
-
AndreyZ
Re: OLE DB Error and Field not found problems
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
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
Thanx for the help !
Regards,
Erik
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
Thanx for the help !
Regards,
Erik
-
AndreyZ
Re: OLE DB Error and Field not found problems
I am glad I could help. Feel free to contact us if you have any further questions about SDAC.