I am receiving an access violation - How do I fix this condition?
I have a buttton that has a sql query action of:
select Transactions.[year], coin.[Description], Transactions.[Mint], Transactions.condition,
Transactions.[Quantity] from Transactions left
outer join [coin] on transactions.[id_coin]=coin.[id]
and on onclick event for the same button
procedure frmTransaction_Button4_OnClick (Sender: string; var Cancel: boolean);
var
id_Orders: integer;
begin
id_Orders := SQLExecute ('SELECT id_Orders FROM Transactions WHERE id=' + IntToStr(frmTransaction.TableGrid1.dbItemID));
frmTransaction.TableGrid1.dbFilter := 'Transactions.id <> ' + IntToStr(frmTransaction.TableGrid1.dbItemID)+ ' and Transactions.id_Orders= ' + IntToStr(id_Orders);
frmTransaction.TableGrid1.dbUpdate;
end;
If I comment out the dbfilter assignment in the onclick event the access violation goes away. The av seems to be related to setting the dbfilter.
Please advise - I am using the latest 1.50 beta.
I've attached a demo to recreate the issue.
Rob
Post's attachments Demo.zip 331.43 kb, 499 downloads since 2015-02-27