Topic: MySQL connect form hiding/calling?

Hi all, is there a way to hide the connect form that pops up every time I run an app connected to a MySQL/MariaDB database?

If yes, is it possible to call it again in case of any change in the connection settings?

What I want to achieve is to hide the Mysql connect form if it already has been filled up and add a button that could pop it open back.

Re: MySQL connect form hiding/calling?

The built-in connection form appears automatically when the application starts. To disable the appearance of the form and automatic connection to the database, use a directive that must be placed in the script.

{$MySQL disable_connectdialog}

begin
end.

The use of this directive assumes that the connection to the database will be carried out using a script.

var
  SQLCon: TMyConnection; // соединение с базой
...

SQLCon := TMyConnection(Form1.FindComponent('MySQLConnection')); // Form1  is main Form
...

function ConnectToDB(AServer: string = ''; APort: integer = 0; ADataBase: string = ''; AUsername: string = '';
  APassword: string = ''): boolean;
begin
  SQLCon.Server := AServer;
  SQLCon.Port := APort;
  SQLCon.Database := ADataBase;
  SQLCon.Username := AUsername;
  SQLCon.Password := APassword;
try
    SQLCon.Connect;
    Result := SQLCon.Connected;
  except
    Result := False;
  end;
end;

I don’t know how to call the built-in connection form using a script.

Визуальное программирование: блог и телеграм-канал.

Re: MySQL connect form hiding/calling?

Does anyone know the name of this form? All I know is that the password is stored in the registry when "save password" is checked

What would be great is to have the login form with a "Mysql connection" tab or folding connection box. Or using OLE ODBC!!