EDatabase Error "unassigned code" - URGENT
When I try to exec a SQL I received the message EDatabaseError "unassigned
code".
The code is:
procedure TFormCupomF1.SQLAddItem;
var SQL : TSQLQuery;
begin
SQL := TSQLQuery.Create(nil);
With SQL do
try
SQLConnection := MyConnection; {MyConnection is open}
NoMetadata := True;
SQL.Add('Insert into ITEMCUPOM( Maquina, Item, Cupom, Produto,
Quantidade, Unitario, Total, TaxaICMS, Cancelado, DataEmissao, Desconto )');
SQL.Add('values( :nMaquina, :nItem, :nCupom, :nProduto, :nQuantidade,
:nUnitario, :nTotal, :nTaxaICMS, :nCancelado, :nDataEmissao, :nDesconto )');
ParambyName('nMaquina').AsSmallInt := 1;
ParambyName('nItem').AsSmallInt := 1;
ParambyName('nCupom').AsInteger := 10;
ParambyName('nProduto').AsString := 'Teste';
ParambyName('nQuantidade').AsFloat := 1;
ParambyName('nUnitario').AsFloat := 1;
ParambyName('nTotal').AsFloat := 1;
ParambyName('nTaxaICMS').AsFloat := 17;
ParambyName('nCancelado').AsSmallInt := 0;
ParambyName('nDataEmissao').AsDateTime := Now;
ParambyName('nDesconto').AsFloat := 0;
Prepared := True;
ExecSQL; {here, on ExecSQL the message is raised}
finally
Free;
end;
end;
What can It be ?
Daniel Dummer