Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UniDAC - SQL Server - OLE DB - CoInitialize #117

Open
ertankucukoglu opened this issue Jan 26, 2022 · 0 comments
Open

UniDAC - SQL Server - OLE DB - CoInitialize #117

ertankucukoglu opened this issue Jan 26, 2022 · 0 comments

Comments

@ertankucukoglu
Copy link

Hello,

I am using MARS with UniDAC database access components. UniDAC has several SQL Server access methods and one is using OLE DB. OLE DB connection needs CoInitialize() in unit Winapi.ActiveX to be called before accessing SQL Server databases. In fact, this has to be called for each thread that will make a connection to an SQL Server database.

I tried to use initialization and finalization sections of Server.Resource.pas but this didn't help as each method may establish a new database connection.

Is it possible to avoid calling CoInitialize() and CoUninitialize() in each method beginning and end respectively? I rather would like to use these calls in events. Is that possible? If yes, I would like to learn these events and how to make it work, please.

Thanks & Regards,
Ertan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant