Page 1 of 1

Access Violation on CoUnInitialize

Posted: Sat 22 Jul 2006 20:49
by vzsolt50
I have SDAC V3.70.3.30.

After using MSConnection1.Connect and MSConnection1.DisConnect, I received an Access Violation error when I call CoUnInitialize.

Please help me! :cry:

Posted: Mon 24 Jul 2006 14:26
by Antaeus
Possibly you try performing some actions with data sets after disconnecting. If you don't, then send us (evgeniyD*crlab*com) a complete small sample to demonstrate it, including script to create and fill table.
Also supply with exact version of MDAC and exact version of Delphi

Posted: Tue 25 Jul 2006 02:32
by rvlahov
I'd like to also get some additional info on how to CoInitialize and CoUnInitialize.

I am new to SDAC and have gotten the "E OLE ERROR" ...800401f0h ... CoInitialization has not been called. error

This happens when I compile. I have see many of the Posts on the forum, but I'd like the specifics of where to place the code and what code to place.

Making an application with D6, MSConnection, TMSStoredProc. I am not farmiliar with threads and am not using them in the application.

Please help/advise.


Posted: Tue 25 Jul 2006 07:02
by Antaeus
If you do not create any additional threads in your application and unit Forms is in uses clause, you are not required to call CoInitialize and CoUninitialize functions manually. Delphi calls them automatically.

Posted: Tue 25 Jul 2006 14:46
by vzsolt50
Dear Antaeus!

I sent a sample application and pictures about exception, via e-mail.
Please, looking and notify me.


Posted: Wed 26 Jul 2006 07:05
by Antaeus
Thank you for sample. We have compiled the application you have sent us and run it. Access violation was not reproduced on FormDestroy event. Try to remove CoInitialize and CoUnInitialize functions from your code and test the application again.