Percorer ADOQuery.RecordSet ERRO.

Delphi

22/09/2013

Estou tentando varrer um ADOQuery para inserir os resultados numa lista, porém ao chegar no último registro exibe um erro.

---------------------------
Debugger Exception Notification
---------------------------
Project DC2.exe raised exception class EOleException with message 'Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record'.
---------------------------
Break Continue Help
---------------------------

vT : string;

for I := 0 to ADOQuery1.RecordCount - 1 do begin
ADOQuery1.Recordset.Move(I,EmptyParam);
{varro todas as combos}
vT := VarToStr(ADOQuery1.Recordset.Fields['Nome'].Value);
vCombo.Items.Add(vT);
end;

O record count exibe o total correto, mas ao tentar ler o último registro gera um erro.

Obrigado.




Aesmo

Aesmo

Curtidas 0

Respostas

Aesmo

Aesmo

22/09/2013

Ahhh, também tentei com Eof.

while not ADOQuery1.Eof do begin

Acontecia o mesmo erro.
GOSTEI 0
POSTAR