Page 1 of 1

AutoRefresh Error 'Unique keyfields required'

Posted: Thu 16 Jul 2009 18:41
by Frega
Hello, again :oops:

I have a TMyQuery named: qPedido, with the following script:

Code: Select all

Select c.email1,c.email_status,c.email_aprovado,c.email_format,c.email_copy,c.email_copy_liberar,p.pedido_cliente,p.pedido_representante,p.cancelado,p.cliente,p.data,p.dataprevisao,p.pedido,p.representante,p.aprovado,p.lote,p.estado, c.razao,u.descricao,e.descricao from pedidos p
inner join r_clientes c on c.id = p.cliente
inner join s_usuarios u on u.id = p.representante
inner join estado e on e.id = p.estado
order by p.pedido desc
limit :limit
when i do a a query.refresh in runtime it works OK, but, im tring to use a AutoRefresh
qPedido.autorefresh:=true;
qPedido.AutoRefreshInterval:=300;

but, when the AutoRefresh time comes, the application raise a exception:
"EDatabaseError with message 'Unique keyfields required'."


what is this? a bug or my mistake?

Posted: Tue 21 Jul 2009 07:09
by Dimon
AutoRefresh executes the RefreshQuick method instead of the Refresh method if a recordset has timestamp fields.