UniDAC 6.3.13 and MSSQL: Error using Savepoints
Posted: Wed 27 Jul 2016 09:51
Hi,
MSSQL Server reports an unsupported operation when using SavePoints.
I´m trying to set up different savepoints within a transaction I can roll back to if something went wrong. Unfortunately even the simplest scenario does not work.
How can I achieve my goal using UniDAC in conjunction with MSSQL?
MSSQL Server reports an unsupported operation when using SavePoints.
Code: Select all
try
{
TUniConnection* Database = new TUniConnection( this );
Database->ConnectString = "Provider Name=SQL Server;Data Source=Rev2K8;Initial Catalog=ocs-reporting;Port=0;User ID=sa;Password=***;Login Prompt=False";
Database->Connect();
Database->StartTransaction();
Database->Savepoint( "SavePoint" );
Database->ReleaseSavepoint( "SavePoint" ); // throws an Exception
Database->Commit();
}
catch( Exception& Excp )
{
MessageDlg( Excp.Message, mtError, TMsgDlgButtons() << mbOK, 0 );
// Message is: "Operation not supported by the database"
}
How can I achieve my goal using UniDAC in conjunction with MSSQL?