Topic: TableGrid1 - вывод данных с помощью скрипта

Добрый день,

помогите, не могу вывести данные с помощью скрипта в таблице

Нашел вот это Form1.TableGrid1.dbSQLExecute
но как туда забить запрос не понимаю.

Задача простая

При загрузке формы, должны подгружаться данные из базы данных.

Возможно на форуме уже был  такой вопрос, но из-за отсутствия поиска по форуму не нашел ((

Re: TableGrid1 - вывод данных с помощью скрипта

Приветствую.



пример

procedure Form1_OnShow (Sender: TObject; Action: string);
begin
    Form1.GridEmployees.dbSQL:='SELECT id, "$autoinc", lastname, firstname, salary FROM employees'; // the id field, want to be able to edit or delete the entry from the table component
    //Form1.GridEmployees.dbParentTable := 'ParentTable';
    //Form1.GridEmployees.dbParentTableId := 1;
    Form1.GridEmployees.dbGeneralTable := 'employees'; // Optional (in the case of complex SQL queries with sub queries, you need to choose the main table of the database, also it need to be able to edit or delete the entry from the table component)
    Form1.GridEmployees.dbListFieldsNames :='delete_col,#,name2,name3,name4'; // If you do not want to see the value of the id in the component table, enter a name for the column delete_col
    Form1.GridEmployees.dbSQLExecute;
end;
Dmitry.