Suggestion SQL generator on embedded system

Asked

Viewed 110 times

0

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

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

From now on I appreciate your help!

  • What would this SQL generator? is a Generator itself, or a query terminal ?

  • 1

    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.

  • Why not install a DBMS? Your database has no password ?

  • 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.

  • 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 ?

1 answer

0

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;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.