Recent

Author Topic: Lazarus with SQLite Database not working  (Read 941 times)

jordicg

  • Newbie
  • Posts: 5
Lazarus with SQLite Database not working
« on: February 21, 2021, 12:38:39 am »
Hello community !!

I am trying to create a Database Application, i have done the connection with a SQLite3Connection control a DataSource a SQLTransaction and a SQLQuery controls, but when i run the application theres no error or warning shown, when i try to add a new record to the database with the Navigation controls nothing happens, neither a error is shown, i have added a line of data to the database but it is not displayed by the DBEdit controls and checkboxes. Any help is appreciated.

egsuh

  • Hero Member
  • *****
  • Posts: 1273
Re: Lazarus with SQLite Database not working
« Reply #1 on: February 21, 2021, 12:55:48 am »
You have to set
       SQLTransaction.Database = SQLite3connection
       SQLQuery.dababase = SQLite3connection
       datasource.dataset = SQLQuery

       DBEdit.datasource = datasource
       DBNavigator.datasource = datasource
     
If you are beginner, you'd better start with TDBGrid.
       
To view the content of database, your SQLQuery.SQL = 'select ....'. 

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: Lazarus with SQLite Database not working
« Reply #2 on: February 21, 2021, 01:20:31 am »
hello,
have a look in my sqlite database example deadly mushrooms in the folder lazarus\examples\database\image_mushrooms of Lazarus distribution.
Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

 

TinyPortal © 2005-2018