2 TADOQUERY master and Detail tablefilter insert

Posted by ml on Stack Overflow See other posts from Stack Overflow or by ml
Published on 2010-05-29T18:42:37Z Indexed on 2010/05/29 18:52 UTC
Read the original article Hit count: 174

Filed under:
|

How can i work with 2 Tadoquery and work like a Tadoquery (master) Tadotable(detail) !!

    var  tempvar : Variant;             
    begin  
    Edit1.text:=Ano.value;
    Begin  
      with Ano_planeamento do //Laço de consulta por codigo  
       Begin  
        Close;    
        SQL.Clear;  
        SQL.Add('SELECT * from planeamento_ano');  
        SQL.Add('Where ano LIKE ''%'+Edit1.text+'%''');  
        Open; 
        end; 
     end; 
     tempvar := Ano_planeamento.fieldbyname('ano').value;  
     planeamento.close;  
     if tempvar <> null then 
     begin  
      planeamento.SQL.Clear; 
      planeamento.SQL.add('SELECT * FROM planeamento');  
      planeamento.SQL.add(' WHERE ano = ');  
      planeamento.SQL.add('''' + tempvar + '''');   
       // here i nead to filter by ....        
      planeamento.open;

© Stack Overflow or respective owner

Related posts about delphi

Related posts about tadoquery