Below is a simple suggestion to help resolve the issue:
In a new form add a Memo, a Grid and 3 buttons (Query, Change and Clean).
A connection component with the database (Adoconnection1, for example), a query (Adoquery, for example) and a Datasource.
Make the necessary changes to access your database.
Names of components used in the project:
Memo = memScript,
Adoquery = qryExecutarSQL,
Buttons = btnConsult, btnAlter and btnLimpar.
Below is the code of each component:
procedure TfrmConsultaBancoDados.btnConsultarClick(Sender: TObject);
begin
Try
with qryExecutarSQL do
begin
close;
SQL := memScript.Lines;
Open;
end;
Except
ShowMessage('Erro ao tentar consultar Banco de Dados');
end;
end;
procedure TfrmConsultaBancoDados.btnAlterarClick(Sender: TObject);
begin
Try
with qryExecutarSQL do
begin
close;
SQL := memScript.Lines;
ExecSQL;
end;
Except
ShowMessage('Erro ao tentar Alterar Banco de Dados');
end;
end;
procedure TfrmConsultaBancoDados.btnLimparClick(Sender: TObject);
begin
memScript.Clear;
end;
procedure TfrmConsultaBancoDados.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
qryExecutarSQL.Close;
end;
What would this SQL generator? is a Generator itself, or a query terminal ?
– Victor Tadashi
It is more a query terminal and database changes, which is not visible to the customer, but on second thought, I will do with password.
– Jefferson Rudolf
Why not install a DBMS? Your database has no password ?
– Victor Tadashi
yes, but that system is in our client’s clients, so I wanted to do something like a generator and not install the database ide to be able to make the changes.
– Jefferson Rudolf
Dude, it’s pretty complex to create a program like this, complex in the sense that you guarantee certain things. What connection component do you use in your main application ?
– Victor Tadashi