procedure TForm1.Button1Click(Sender: TObject);
var myVariable:Integer;
myQry:TADOQuery;
begin
TryStrToInt(Edit1.Text,myVariable);
Try
myQry:=TADOQuery.Create(nil);
myQry.Connection:=myConnection;
myQry.SQL.Text:='select * from ventas where numarticulo = ' + Inttostr(myVariable);
myQry.Open;
while not myQry.Eof do
Begin
//recorreres el cursor y haces lo que tengas que hacer con el resultado
y voy llenando los datos en otro componente...digamos stringsgrid
variable:= myQry.FieldByName('nombre_campo').AsInteger;
variable2:= myQry.FieldByName('nombre_campo_2').AsString;
etc;
//
myQry.Next;
End;
Finally
FreeAndNil(myQry);
End;
end;