E2010 Incompatible types: Variant and TADOQuery qual o motivo ? DELPHI

Delphi

06/03/2017

Oque está ocasionando esse erro ?
Desde já agradeço

 while dm.qConsulta.eof=false do begin
        dm.qExecuta.sql.text := 'INSERT INTO GTELPERM (ID_PERM,ACESSO,ID_GRUPO) VALUES (:WID_PERM,"N",:WID_GRUPO)';
        dm.qExecuta.Parameters.ParamByName('WID_PERM').Value := dm.qConsulta; // ERRO APARECE NESSA LINHA
        dm.qExecuta.Parameters.ParamByName('WID_GRUPO').Value := aux;
        dm.qExecuta.ExecSQL;

        dm.qConsulta.Next;
   end;
Rodrigo Oliveira

Rodrigo Oliveira

Curtidas 0

Respostas

Raylan Zibel

Raylan Zibel

06/03/2017

dm.qExecuta.Parameters.ParamByName('WID_PERM').Value := dm.qConsulta; // ERRO APARECE NESSA LINHA

Você tem que passar um campo da query pro parâmetro, não o objeto query inteiro. Falou especificar o Field.
GOSTEI 0
Raylan Zibel

Raylan Zibel

06/03/2017

dm.qExecuta.Parameters.ParamByName('WID_PERM').Value := dm.qConsulta.FieldByName('WID_PERM').Value;
GOSTEI 0
POSTAR