Recent

Author Topic: Sqlite and controls  (Read 1802 times)

Zvoni

  • Hero Member
  • *****
  • Posts: 2719
Re: Sqlite and controls
« Reply #15 on: August 06, 2024, 03:14:02 pm »
Hello everyone

I am starting to see the light. Had to start rock bottom with a normal DBF file and just the Tdatasource & Tdbf control.
Populate the Tlookupcombo and the Tdbgrid correctly.

Interestingly, the TDBF has a file path where you set the path to the database.
I would like it to be in the folder wherever i copy the project to.
If i use the folder settings in the control, it goes looking for that dbf in that folder after compile.

So how do I set that path to be just the local folder that there is no issues when i copy the finished project somewhere else?

Regards,

Peter
Huh?
What's wrong with GetCurrentDir? https://www.freepascal.org/docs-html/current/rtl/sysutils/getcurrentdir.html
Nevermind just adding a SubFolder to it

Code: Pascal  [Select][+][-]
  1. MyDBF:=GetCurrentDir+'\MySubFolder';

EDIT: TApplication.Location might be an alternative.
https://lazarus-ccr.sourceforge.io/docs/fcl/custapp/tcustomapplication.location.html
« Last Edit: August 06, 2024, 03:16:47 pm by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018