str:=Table1.Tablename; Query1.Close; Query1.SQL.Clear; Query1.SQL.Add(format('select * from %s',[Str])); Query1.Open;