Coinitialize error on IntraWeb using ADO

时间秒杀一切 提交于 2019-12-05 18:48:10
Olaf Monien

The "solution" provided in the link you quoted is basically wrong or at least incomplete. Only by setting ServerController.ComInitialization to ciMultiThreaded to true IW will gurantee that every thread will get COM initialized correctly. (for example think about Ajax callbacks)

If you create your own custom threads then you will have to call CoInitialize for that thread on your own though - as Intraweb does not know about your custom threads.

Just found an answer to this here:

I found a more elegant solution as the whole problem originated from using Intraweb, I rather get Intraweb to initialise com for me. This sorts it out nicely.

When using your MS SQL DbExpress driver or ADO driver with Intraweb, you must set the ComInitialization property in the ServerController to ‘ciMultiThreaded’.

This will eliminates the "CoInitialize has not been called" error.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!