I have an idea to make a button for the users with MyTransaction.Commit when in the transaction are the uncommitted data.
I want to recognize are there uncommitted insert/update/delete queries. Uncommitted select should not highlight “Commit” button. How to provide this? Can anyone help me?
regards
M
Recognize uncommitted transaction
You can add some variable to hold the transaction state. Add also handlers for the AfterExecute and AfterUpdateExecute events for all TBCQuery components. The code may look like the following:
procedure TForm1.IBCQuery1AfterExecute(Sender: TObject; Result: Boolean);
begin
if not TCustomIBCDataSet(Sender).IsQuery then
HasUncommitedTransaction := True;
end;
procedure TForm1.IBCQuery1AfterUpdateExecute(Sender: TDataSet;
StatementTypes: TStatementTypes; Params: TDAParams);
begin
if [stInsert, stUpdate, stDelete] * StatementTypes [] then
HasUncommitedTransaction := True;
end;
procedure TForm1.IBCQuery1AfterExecute(Sender: TObject; Result: Boolean);
begin
if not TCustomIBCDataSet(Sender).IsQuery then
HasUncommitedTransaction := True;
end;
procedure TForm1.IBCQuery1AfterUpdateExecute(Sender: TDataSet;
StatementTypes: TStatementTypes; Params: TDAParams);
begin
if [stInsert, stUpdate, stDelete] * StatementTypes [] then
HasUncommitedTransaction := True;
end;
Re: Recognize uncommitted transaction
Hi... As you can see... some time ago I asked you for a way to detect uncommited transaction. Your solution was so good, so it survived for years. Unfortunately when I upgraded my IBDAC to the version dated on February the 27'th, it does not work anymore. I got a messages:
Undeclared Identifier stInsert, stDelete and
Incompatible types: 'Integer' and '_TStatementtype'
Can you tip me what to use in this case?
regards
Mario
Undeclared Identifier stInsert, stDelete and
Incompatible types: 'Integer' and '_TStatementtype'
Can you tip me what to use in this case?
regards
Mario
Re: Recognize uncommitted transaction
To solve the problem, you should add the DASQLGenerator module to the Uses section.
We will change this behavior in the next IBDAC build, so there will be no need to add the DASQLGenerator unit to the USES clause.
We will change this behavior in the next IBDAC build, so there will be no need to add the DASQLGenerator unit to the USES clause.
Re: Recognize uncommitted transaction
Thank you 
Re: Recognize uncommitted transaction
We thank you for your interest in our products.
Feel free to contact us if you have any further questions about IBDAC.
Feel free to contact us if you have any further questions about IBDAC.