Need SQL Help lazarus / 16-Databases ---------------------------------------------------------------------- greertr · 2017-01-11 22:34 This unit continues to give me sql errors...I'm weak on sql, so I decided to post the entire unit code and see if someone is willing to help me get it going. Right now I can't check the ZConnection Connected or ZQuery Active checkboxes in the Object Inspector, so I tried putting them into the form.create - still getting sql errors but can't open the database. any help would be appreciated... EDIT:  Got it resolved - found the bug - shot in the ole' foot - I had renamed the folder containing the db but neglected to update the data base path in the object inspector ---------------------------------------------------------------------- mangakissa · 2017-01-12 08:11 This has nothing to do with weak on SQL, but designing. This is what I do: Create a 'global' datamodule.Put component Zconnection on itFill in the required propertiesCheck your connection to the database (if it works @designtime, it also works @runtimeGo to the project options --> formsMake sure the datamodule will created before you mainform In auto-createforms should be filled like this: datamodule1 form1close the project options formNow you can do two things: Open your database in de Oncreate of the datamoduleOpen your database in de FormCreate of your mainform. This works now, because the datamodule and its components are already loaded in memory and can be accessed. don't forget to put the datamodule in the uses. It's you choice, but in this way the connection always works (if the database is found). ---------------------------------------------------------------------- greertr · 2017-01-12 11:04 Thx again Manga!