Location database in designmode lazarus / 16-Databases ---------------------------------------------------------------------- mangakissa · 2017-11-27 09:05 Using TSQLiteconnection and TSQUery. In TSQLiteconnection.database the following value is set: ./databasename.db3. TSQLiteconnection.connected is set to true; database connected. Now opening TSQLquery whith propert active to true results an error : TSQLiteconnection: no such table But running the application the table is found with the same value set in property database. How is this possible. Is TSQLiteconnection still looking in the lazarus installation directory? If I'm using a full path the the database, it's working fine. I know './' tells to look in the current directory, but if it is the database should not be connected at all. ---------------------------------------------------------------------- wp · 2017-11-27 09:11 At designtime the "./" usually refers to the folder in which lazarus.exe is found. Therefore, don't use relative paths at designtime. And: after you set up your database delete the path to the db file from the object inspector and set it at runtime. Otherwise your program will run only if the destination computer has the exact folder structure as your development computer, and if you'll decide to rearragne folders on your deveopment computer some time later you will not even be able to load the project any more. ---------------------------------------------------------------------- Thaddy · 2017-11-27 09:57 Quote from: wp on November 27, 2017, 10:11:54 amTherefore, don't use relative paths at designtime. Yukk...  Absolutely not.... introduces bugs.... Always use relative paths to your intended installation. NEVER use hardcoded paths. In this case set an environment variable during development. wp is fired. He knows why. ---------------------------------------------------------------------- wp · 2017-11-27 10:22 Quote from: Thaddy on November 27, 2017, 10:57:22 amwp is fired. He knows why. ? ---------------------------------------------------------------------- mangakissa · 2017-11-28 07:36 @wp Ususally I do, but for my demo not. I find it strange that a connection is made to the SQLite database, but the table is not found. That's my question. Or it looks like TSQListeconnection opens a file if not exist and then the table is not found because of an empty database. ---------------------------------------------------------------------- taazz · 2017-11-28 07:37 Quote from: mangakissa on November 28, 2017, 08:36:17 am@wp Ususally I do, but for my demo not. I find it strange that a connection is made to the SQLite database, but the table is not found. That's my question. Or it looks like TSQListeconnection opens a file if not exist and then the table is not found because of an empty database. 1)SQLite will create the database if it is not found on the disk. It is part of the C code not the pascal bindings. 2) if you do not specify your base directory for your relative paths then windows will auto expand the global system param currentDir which might or might not be your application's directory. Append manually at run time your base directory to all relative paths eg 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 function BaseDir :Stringbegin  result := IncludeTeailingPathDelimiter(ExtractFileDir(paramstr(0)));end;  and change your property to the database as TSQLiteconnection.database := basedir+TSQLiteconnection.database; This should solve all of your database problems.