Estou fazendo uma consulta para a grade horario minha, mas quando ele passa por aqui:
if (QryAgenda.FieldByName('Bloqueado').AsInteger = 0) then
.......
quando ele passa e o Bloqueado é 1 ele me mostra, mas quando é 0 ele não retorna nada.
for x:=1 to 16 do
begin
for y:=1 to 7 do
begin
z:=z+1;
if TpsvBorderLabel(FindComponent( 'Hor' + IntToStr( x ) ) ).Caption<>'' then
begin
QryAgenda.close;
QryAgenda.sql.Clear;
QryAgenda.sql.Add('Select * From Praticas where Instrutor = :Inst and data = :PDATA and horario = :PHORARIO');
QryAgenda.ParamByName('Inst').AsString := txtcodins.Text;
QryAgenda.ParamByName('Pdata').AsDate := StrtoDate(TPanel(FindComponent('Pan' + IntToStr( y ) ) ).Caption);
QryAgenda.ParamByName('Phorario').AsTime := StrToTime(TpsvBorderLabel(FindComponent( 'Hor' + IntToStr( x ) ) ).Caption);
QryAgenda.open;
end;
while ( not QryAgenda.Eof) do
begin
if (QryAgenda.FieldByName('Bloqueado').AsInteger = 0) then
begin
TEdit( FindComponent( 'Al' + IntToStr ( y ) + IntToStr ( z ) ) ).Text:= '**********';
end
else
begin
TEdit( FindComponent( 'Al' + IntToStr ( y ) + IntToStr ( z ) ) ).Text:= StrZero(QryAgenda.fieldByName('Aluno').AsInteger,6);
TEdit( FindComponent( 'Ct' + IntToStr ( y ) + IntToStr ( z ) ) ).Text:= QryAgenda.fieldByName('Categoria').AsString;
end;
QryAgenda.Next;
end;
end;
end;
Já fiz o Debug e vi que não mostra nada mesmo, mas por que será ?????
Pergunta
robinhocne
Estou fazendo uma consulta para a grade horario minha, mas quando ele passa por aqui:
if (QryAgenda.FieldByName('Bloqueado').AsInteger = 0) then .......quando ele passa e o Bloqueado é 1 ele me mostra, mas quando é 0 ele não retorna nada.for x:=1 to 16 do begin for y:=1 to 7 do begin z:=z+1; if TpsvBorderLabel(FindComponent( 'Hor' + IntToStr( x ) ) ).Caption<>'' then begin QryAgenda.close; QryAgenda.sql.Clear; QryAgenda.sql.Add('Select * From Praticas where Instrutor = :Inst and data = :PDATA and horario = :PHORARIO'); QryAgenda.ParamByName('Inst').AsString := txtcodins.Text; QryAgenda.ParamByName('Pdata').AsDate := StrtoDate(TPanel(FindComponent('Pan' + IntToStr( y ) ) ).Caption); QryAgenda.ParamByName('Phorario').AsTime := StrToTime(TpsvBorderLabel(FindComponent( 'Hor' + IntToStr( x ) ) ).Caption); QryAgenda.open; end; while ( not QryAgenda.Eof) do begin if (QryAgenda.FieldByName('Bloqueado').AsInteger = 0) then begin TEdit( FindComponent( 'Al' + IntToStr ( y ) + IntToStr ( z ) ) ).Text:= '**********'; end else begin TEdit( FindComponent( 'Al' + IntToStr ( y ) + IntToStr ( z ) ) ).Text:= StrZero(QryAgenda.fieldByName('Aluno').AsInteger,6); TEdit( FindComponent( 'Ct' + IntToStr ( y ) + IntToStr ( z ) ) ).Text:= QryAgenda.fieldByName('Categoria').AsString; end; QryAgenda.Next; end; end; end;Já fiz o Debug e vi que não mostra nada mesmo, mas por que será ?????
Editado por robinhocneLink para o comentário
Compartilhar em outros sites
4 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.