How changing path DBF file at runtime lazarus / 16-Databases ---------------------------------------------------------------------- MVD · 2017-09-22 20:34 Hi, I wonder if it is possible to change the path from my DBF files at runtime. Now the path is hardcoded in the visual component, but if someone else will use the program or if the location of the files changed, I would have the possibility to change the path at runtime. I was looking to the different components but I wonder witch can give the full path I selected as return value. Thanks! ---------------------------------------------------------------------- PatBayford · 2017-09-22 21:02 Need a little more info to give a definitive answer - like what database components you are using. It is certainly possible to change the paths while the application is running, just remember to close any active database components first, and re-open them after you set the path. If necessary you could even use the TOpenDialog to allow your users to select files from the local machine, using file type filters you provide. ---------------------------------------------------------------------- JanRoza · 2017-09-22 22:29 I always have the (SQLite) database in the folder where the program was installed and at program start do something like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i         // Open database       DataModule1.DbConnection.Connected := False;       DataModule1.DbConnection.DatabaseName := SysUtils.ExtractFilePath(ParamStr(0)) + 'DatabaseName.db';       DataModule1.DbConnection.Connected := True;        if DataModule1.DbConnection.Transaction.Active = False       then DataModule1.DbConnection.Transaction.StartTransaction;  In the same way you can assign any path you like to your database. Maybe this idea helps you. ---------------------------------------------------------------------- mangakissa · 2017-09-23 06:41 Code: [Select]if it depends on TDBF, try this: [code = pascal] MyPath := .FilePathFull := MyPath; //Directory where all .dbf files will be stored Look at http://wiki.freepascal.org/Lazarus_Tdbf_Tutorial