[SOLVED] Store Database in Windows' AppData lazarus / 16-Databases ---------------------------------------------------------------------- Slyde · 2020-11-15 20:10 I currently use 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 Database := ExtractFilePath(Application.ExeName) + 'data.db'; to create and store 'data.db'. How, on Windows, can I set the db path to AppData instead of where the application's stored? Like: 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 Database := (The Pascal Way Of Accessing C:\Users\\AppData) + 'data.db'; ---------------------------------------------------------------------- howardpc · 2020-11-15 20:24 LazFileUtils has a functionCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i GetAppConfigDirUTF8()Is that what you are looking for? ---------------------------------------------------------------------- Slyde · 2020-11-15 21:04 Hey howardpc. I don't think so, or I don't understand how to use it.  I've revised my post to reflect better what I need. ---------------------------------------------------------------------- Sieben · 2020-11-15 22:04 You might want to have a look at this one: https://forum.lazarus.freepascal.org/index.php?topic=34273.0 ---------------------------------------------------------------------- trev · 2020-11-15 23:06 See the Wiki article Windows - Getting special folders. ---------------------------------------------------------------------- Slyde · 2020-11-15 23:14 Thanks for all the help. Opened the right doors. 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 procedure TForm1.ButtonClick(Sender: TObject);var  sWindowsDir : String;begin  sWindowsDir := SysUtils.GetEnvironmentVariable('APPDATA');  ShowMessage(sWindowsDir);end;