Topic: Connect to MySql

Good morning.

I finaly succeeded to connect to a MySql server and I also have made a simple database

- Is it possible to translate the captions (Server (host), Port, User ..)  on the connection form? (see connect .jpg)
- Is it possible to use User/Role function when I use MySql ?

Post's attachments

Attachment icon connect.JPG 34 kb, 113 downloads since 2020-11-11 

2 (edited by brian.zaballa 2020-11-13 05:13:43)

Re: Connect to MySql

You might want to use the script to connect in your server. In that way you can use external file, a hidden label on a hidden form (which I'm using) to read the server details for additional security..
Check this: http://myvisualdatabase.com/forum/viewtopic.php?id=5366

brian

Re: Connect to MySql

Hello Brian. Thanks very much for your answer and I will try to login to my mysql-server by script. But I donot understand your following instructions/advice: "In that way you can use external file, a hidden label on a hidden form (which I'm using) to read the server details for additional security" Can you please make a short example of 1) external file", 2) hidden label on hidden form etc.

Re: Connect to MySql

Hello kees.krause, Hello Brian

As brian gave you a clue to connect to the server, to have a connection form translated into your language, you can create your own connection form translated into your language

JB

Re: Connect to MySql

Hey Jean. Thanks for your contribution. In my opinion the login form for MySql is generated automaticly by MVD? How can I generate my own form to connect ot my server? Maybey it's a stupid question, but a small example would certainly help.

Re: Connect to MySql

Hello kees.krause

Look at attachment

Is it OK for you ?

JB

Post's attachments

Attachment icon Connect.jpg 56.97 kb, 104 downloads since 2020-11-13 

Re: Connect to MySql

If you use the script method, then you do not need a form to translate. Your users do not need to enter in the database connect info each time they start your program. I would recommend this approach.

Re: Connect to MySql

Hello ehwagner

You're right. With a script for connection, no need to translate this form.

It all depends on how keese.krause will want to distribute its application.

JB

Re: Connect to MySql

Hi Jean, For me the connectform is fine

Re: Connect to MySql

Hallo Brian and Jean. Thans for your contributions, but it is a pitty  that my questions stay unanswered. I asked Brian for explaination about external file, hadden label and form and more security and I do not know how to use the form of Jean.

11

Re: Connect to MySql

Hi Kees,


I think Brian means using a file similar to MVD's 'Settings.ini'.

To load a ini file use code similar to:


procedure loadSettings;
var
  settingsIni : TStringlist;
  lngth : integer;
begin
   settingsIni := TStringList.Create;
   settingsIni.LoadFromFile ('Settings.ini');
   dbName := SettingsIni[4];
   SettingsIni.free;
   lngth := Length(dbName) - 7;
   dbName := copy(dbName, 8, lngth);
   FrmMain.lbDbPath.Caption := ExtractFilePath(Application.ExeName)+ dbName;
end;

That code is for loading the standard settings.ini file and finding the name of the database.

To save a file change LoadFromFile to SaveToFile .

On a clear disk you can seek forever