procedure TForm1.init_all;
begin
init_DBGrid;
init_DataSource1;
init_ODBCConnection1;
init_SQLTransaction1;
init_SQLQuery1;
end;
procedure TForm1.init_DBGrid;
begin
DBGrid1.DataSource := DataSource1;
end;
procedure TForm1.init_DataSource1;
begin
DataSource1.DataSet :=SQLQuery1;
end;
procedure TForm1.init_ODBCConnection1;
begin
ODBCConnection1.DatabaseName := 'lib_for_GUI';
ODBCConnection1.UserName := '';
ODBCConnection1.Password := '';
ODBCConnection1.Transaction := SQLTransaction1;;
ODBCConnection1.Connected := true;
end;
procedure TForm1.init_SQLTransaction1;
begin
SQLTransaction1.DataBase := ODBCConnection1;
SQLTransaction1.Active := true;
end;
procedure TForm1.init_SQLQuery1;
begin
SQLQuery1.DataBase := ODBCConnection1;
SQLQuery1.Transaction := SQLTransaction1;
SQLQuery1.SQL.Text := 'select * from Altium';
SQLQuery1.UsePrimaryKeyAsKey := false;
SQLQuery1.Active := true;
end;