Topic: read table

is it possible to read table from mySQL database to Visual Database ?

Re: read table

Hello,


You can populate TableGrid using button with action "SQL Query"


also you can use script:

procedure Form1_bScript_OnClick (Sender: string; var Cancel: boolean);
begin
    Form1.GridEmployees.dbSQL:='SELECT id, lastname, firstname, salary FROM employees'; // the id field, want to be able to edit or delete the entry from the table component
    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.