OLE DB error occurred. Code 80004005h
Posted: Thu 02 Jul 2020 09:23
Hello,
UniDAC 8.2.5
Delphi 10.2 Version 25.0.31059.3231
Microsoft SQL Server 2017 (RTM-CU20) (KB4541283) - 14.0.3294.2 (X64) on Windows Server 2016 Standard 10.0 <X64> (Build 14393: ) (Hypervisor)
UniQuery sometime crashes with exception EUniError # ErrorCode:-2147467259 # OLE DB error occurred. Code 80004005h
Query executed in separate thread
One UniConnection and one UniQuery objects per each thread
CoInitializeEx(Nil, COINIT_MULTITHREADED) is used
How to obtaine native SQL Server error message for detect error reason?
UniDAC 8.2.5
Delphi 10.2 Version 25.0.31059.3231
Microsoft SQL Server 2017 (RTM-CU20) (KB4541283) - 14.0.3294.2 (X64) on Windows Server 2016 Standard 10.0 <X64> (Build 14393: ) (Hypervisor)
Code: Select all
SELECT COUNT( ID ) FROM SomeTable WHERE <Condition>
Query executed in separate thread
One UniConnection and one UniQuery objects per each thread
CoInitializeEx(Nil, COINIT_MULTITHREADED) is used
Code: Select all
FConnDB := TUniConnection.Create( Nil );
FConnDB.ProviderName := 'SQL Server';
FConnDB.SpecificOptions.Add( 'SQL Server.Provider=prNativeClient' );
FConnDB.SpecificOptions.Add( 'SQL Server.NativeClientVersion=nc2012' );
FConnDB.LoginPrompt := False;
FConnDB.AutoCommit := False;
FConnDB.Server := <server_name>;
FConnDB.Database := <database_name>;
FConnDB.Username := <string_data>;
FConnDB.Password := <string_data>;