Lazarus and Firebird Basic lazarus / 16-Databases ---------------------------------------------------------------------- dstp · 2024-10-31 15:58 Hello and thanks for taking time to help I am hoping to create a simple database app using lazarus with firebird I managed to create a Firebird database and it's running on my local system. I managed to create a Lazarus app and connected all required (I think) components. I am using components from the SQLdb tab Components as follows SQLConnector SQLQuery : SQL "SELECT * FROM remind" SQLTransaction Datasource On a form I have DBGrid DATEPICKER DBNavigator All components are hooked up and the database is active. I Run the program and all components are active. I click the INSERT button on DBNavigator I enter that data in the respective fields THE PROBLEM When I click POST on the DBNavigator the Form and controls refresh and everything is disabled and the record is not saved??? Is there perhaps a tutorial Video or Text that outlines steps to create a simple working CRUD Database using SQLdb components. Or should I be using other component set such as Zeos or other. I want to create a simple app for reminders. I am using Firebird for it's simplicity and ability to work with dates (better than sqlite for example) If you require more info to help let me know. Thanks in advance for any suggestions :-) ---------------------------------------------------------------------- Jurassic Pork · 2024-10-31 16:49 Hello, have a look to my database example : Lazarus/Examples/Database/Image_Mushrooms can use sqlite or firebird Friendly, J.P ---------------------------------------------------------------------- Handoko · 2024-10-31 16:51 Also try this SQLite demo: https://forum.lazarus.freepascal.org/index.php/topic,65185.msg496461.h tml#msg496461 With very few modification, the demo can work with Firebird database too. ---------------------------------------------------------------------- dstp · 2024-10-31 21:30 Thank You Jurassic Pork and Handoko I will examine the examples you provided. Just after I posted, I decided to try zeos. I was able to create a simple (drag and drop) database where I could add records. I want to use Firebird because of it's ability to work with dates better than sqlite. It is my understanding that sqlite does not support dates directly and requires a bit more work.  I also did not know that there were examples projects in the Lazarus folder so thanks for that bit of info. It will come in handy. :-) ---------------------------------------------------------------------- rvk · 2024-11-01 08:40 Quote from: dstp on October 31, 2024, 04:58:31 pmWhen I click POST on the DBNavigator the Form and controls refresh and everything is disabled and the record is not saved??? It's difficult to say what is going wrong here. When working with transactional databases (what Firebird is) you do need to handle transactions correctly. If you didn't code anything and you just use the TDBNavigator... then a transaction is started. But if you close the database (or your program) without committing the transaction, all changes will be lost. The TSQLQuery has some options to do this automatically. You can set sqoAutoApplyUpdates, sqoAutoCommit and sqoKeepOpenOnCommit in the options. After doing that... you posts will stay in the database. Quote from: dstp on October 31, 2024, 10:30:47 pmIt is my understanding that sqlite does not support dates directly and requires a bit more work.Actually... SQLite does support dates... but does not have specific date fields. SQLite is a bit of an odd duck regarding SQL standards. It has few datatypes and in the TEXT field it can handle (and supports) different types of variables. So SQLite can actually put dates in TEXT, REAL and INTEGER fields. And it supports those dates in those fields just fine. You just need to know how to handle them. https://www.sqlite.org/datatype3.html For simple single use database SQLite is the way to go. Although I prefer Firebird myself, because you can switch between 'embedded' and full server without changing anything in code. But if you are going to use Firebird (or other transactional database) you need to learn more about transactions. ---------------------------------------------------------------------- egsuh · 2024-11-01 10:18 Please post the simplest form that you have difficulty, only with a few fields of DB.