Access Violation on CoUnInitialize

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
vzsolt50
Posts: 2
Joined: Sat 22 Jul 2006 19:17

Access Violation on CoUnInitialize

Post by vzsolt50 » Sat 22 Jul 2006 20:49

I have SDAC V3.70.3.30.

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

Please help me! :cry:

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 24 Jul 2006 14:26

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

rvlahov
Posts: 1
Joined: Tue 25 Jul 2006 01:55
Location: New York

Post by rvlahov » Tue 25 Jul 2006 02:32

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.

rvlahov

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 25 Jul 2006 07:02

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.

vzsolt50
Posts: 2
Joined: Sat 22 Jul 2006 19:17

Post by vzsolt50 » Tue 25 Jul 2006 14:46

Dear Antaeus!

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

vzsolt50

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 26 Jul 2006 07:05

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.

Post Reply