Fórum Percorer ADOQuery.RecordSet ERRO. #456161
22/09/2013
0
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.
---------------------------
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
Curtir tópico
+ 0
Responder
Posts
22/09/2013
Aesmo
Ahhh, também tentei com Eof.
while not ADOQuery1.Eof do begin
Acontecia o mesmo erro.
while not ADOQuery1.Eof do begin
Acontecia o mesmo erro.
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)