our TD application connects to a MS SQL Server database using OLEDB and SqlUDL.
In the past, we used the OLEDB Provider 'SQLOLEDB' (which is part of Windows itself).
But MS has depreciated this old driver years ago (which uses TLS 1.0).
The new one is 'MSOLEDBSQL' (which uses TLS 1.2).
Due to security reasons, our customer does not allow to use the old driver any more.
I have installed the new driver and changed the connection string.
I am able to connect and I can select and update data.
But if I execute 'commit', I get the following error:
Err No: 266 :Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0.;
This happens with TD 4.2 and with TD 7.4.1.
Here is my sourcecode:
Code: Select all
Set SqlUDL = 'MSOLEDBSQL;Data Source=SRVSQL01;Initial Catalog=SO_MAIN_Dev;Integrated Security=SSPI;Persist Security Info=False;'
Call SqlConnect( hSql )
Call SqlSetParameter( hSql, DBP_AUTOCOMMIT, FALSE, '' )
Call SqlPrepareAndExecute( hSql, "update dbo.Ini set Val = 2 where Id = 1" )
Call SqlPrepareAndExecute( hSql, 'Commit' )
What do I have to change not to receive this error?
Regards,
Rainer