Suggestion SQL generator in embedded system

0

I have an embedded system that stays in the client, but I need to develop a SQL generator that is free access to the consultants and invisible to the client, ie with a shortcut key it opens the SQL generator, but by path of the doubts the client can open the SQL generator by the shortcut key.

I wanted a suggestion of what could be done, with a password or something related to it.

Thanks in advance for your help!

    
asked by anonymous 17.08.2016 / 22:48

1 answer

0

Here's a simple hint to help resolve the issue:

In a new form add a Memo, a Grid and 3 buttons (See, Change and Clean). A database connection component (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 = qry RunSQL, Botoes = btnConsult, btnChange and btnClear.

The following is the code for 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;
    
29.08.2016 / 22:53