Makes sense, so the only line of code I need in the DataModule is in the Create:
ConnectPMSDB.DatabaseName:= SysUtils.ExtractFilePath(ParamStr(0)) + 'PMSDB.sqlite';
Also, in the PMS.lpr which on compile on the complete app creates the PMS.exe. The PMS.lpr I designed Forms, DMPMS (datamodule), PMSMain (the opening form for the app which has no database usage, it's just Menu and SpeedBtns for the user to open Units for Clients Mgt, Invoices, etc. As far as order, the first unit listed is the DMPMS (datamodule), PMSMain (main for accessing the rest of the units), printer4lazarus, lazcontrols, etc. Next, in the LPR is the Application.Title, scaled, Initialize and then Application.CreateForm(TDmPMSDataBase, DmPMSDataBase)-datamodule first, then CreateForm(TFrmPMSMain, FrmPMSMain)
So, my understanding cdbc, the DataModule has on it's form with the ConnectPMSDB(TSQLite3Connection), the TransPMSDB(TSQLTransaction) and the QueryPMSDB(TSQLQuery) components on it. The Connect has it's Transaction, the Trans has it's ConnectPMSDB and the Query has it's ConnectPMSDB and it's Trans(TransPMSDB).
The only line of code I need in the DataModule OnCreate event is:
ConnectPMSDB.DatabaseName:= SysUtils.ExtractFilePath(ParamStr(0)) + 'PMSDB.sqlite';
because that is assigned to the Database item in ConnectPMSDB.
So, in the PMS.lpr the datamodule and the main form is created after and the datamodule is in memory with the database connected.
As the user clicks on Clients Mgt. all I need to do is have a procedure for Setup to create a query QueryPMSDB to create the connection to the database, QueryPMSDB.database:= the previous ConnectPMSDB and then the transaction. Then on the FormShow, QueryPMSDB.SQL.Text:= 'SELECT * FROM Clients; the Clients table.
If this is the correct order of things, then I can start working on each unit as far as connecting, trans and query the table(s) in each unit called by the PMSMain unit.