Lazarus
Programming => Databases => Topic started by: elico on October 28, 2015, 08:53:41 pm
-
Hi all
I am new to LAZARUS, hope to acquire the skills involved in database design with lAZARUS.
I used to work with DELPHI 4 in the past.
My main intention is doing small databases .
What is the best way to start ?
Thanks
Elico
-
Step number 1 : Get yourself a computer.
Step number 2 : turn the computer on.
Step number 3 : download Lazarus.
:) :) :)
I'm joking. But you realy need to download and install Lazarus if you want to start programing with it. Next, you should pick a DB that you will use, there are free software DataBases on the internet, for example MySQL, FirebirdSQL, Postgres, SQLite (this one is good for a single user application, no server setting needed)... Next step should be reading documentation and trying. And again. And again... then again, read documentation and try, and so on... here's a useful link: http://wiki.freepascal.org/Lazarus_Database_Overview
-
The videos by MrTKramer3 on youtube are very helpful.
He has a series of 3 on connecting to firebird/mysql databases from lazarus.
The first one is here https://www.youtube.com/watch?v=pq2oCiJePHo
You'll need to install firebird and flamerobin as well as lazarus if you don't already have them on your machine.
He uses both firebird and mysql so you could mysql instead.
-
I did not explained my self well .
I do not care at the moment about any SQL server staff.
I am concerned with the design of the database GUI meaning forms and data fields themselves .
Ho I do that with LAZARUS ?
Thanks
Elico
-
Did you read the tutorials or saw the videos they linked? They explains what you need.
-
I am concerned with the design of the database GUI meaning forms and data fields themselves .
Ho I do that with LAZARUS ?
Thanks
Elico
I don't think you can do that without a database in place first.
So if I was in your shoes I would do this:
1: install firebird. Firebird doesn't have a GUI interface
2: So then, install flamerobin which is a GUI management tool for firebird.
3: Use flamerobin to create a very simple one table firebird database
4: Install Lazarus
5: watch MrTKramer3's videos on hooking up Lazarus to firebird linked to above.
If you do all that you will achieve quite a lot in a short time.
-
There is this also this very comprehensive how-to video that goes through everything for lazarus and sqlite and sqlite manager.
https://www.youtube.com/watch?v=k8Ld5Oxn41g
-
@elico: Are you going to work with SQL at all? Or do you intend to use flat files as "databases"?
-
I would like to start with flat files databse because I want to avoid the head ake of installing SQL server on tharget computer.
Elico
-
Leave the SQL aside , I want to know how to build the end use program at first .
How do I use lazarus components to build the forms and the data fields that make the forms ?
Say I need to do a databse program that is used by srtamp collectors to
manage their collctions .
The forms consist on pictures and data text fields .
How do I build those forms at design time with LAZARUS ?
Put aside the SQL stuff for now I will integrate it later hopefully SQLlite .
Elico
-
hello,
for a stamp collection database, you can adapt my database sqlite example deadly-mushrooms ( in lazarus distribution >= 1.4 - Lazarus/Examples/database/image_mushrooms)
friendly, J.P
-
If you are going to work with flat-files then you should read this link http://wiki.freepascal.org/Lazarus_Tdbf_Tutorial . Thats a good read for using DBF with Lazarus.
EDIT: I just saw that you actualy need a stamp-colection catalog. I can confirm that Jurassic Pork's demo-program located in Lazarus/Examples/database/image_mushrooms is excelent for that. It uses SQLite (that is a light database, not need server setting, perfect for only single user applications). Fastest and most educational way to start.
-
I would like to start with flat files databse because I want to avoid the head ake of installing SQL server on tharget computer.
Elico
You could also use the embedded version of Firebird which doesn't require a server to be install. All you need to do is to download and extract the zip file. Of course as Old_Dog pointed out you would also need to download a tool like FlameRobin or Mitec Interbase Query (both free tools) as a GUI to design a database.
You would also need to copy the dlls in the firebird embedded folder to the folder that contains the .exe file for your project
http://sourceforge.net/projects/firebird/files/firebird-win32/2.5.4-Release/Firebird-2.5.4.26856-0_Win32_embed.zip/download
http://www.flamerobin.org/
http://mitec.cz/ibq.html
-
I am certainly not starting a firebird flame all over again, but if you want interoperability with mainstream other applications plz do not choose Firebird for embedded. Use Sqlite for embedded.
Otherwise: if that's not important, firebird is an option as an embedded solution.
For larger projects I would never ever go with Firebird, because it is definitely not a mainstream solution and might get you into trouble with maintenance and interoperability with other software, like f.e. spreadsheets. These do not have a clue (ODBC if and when a driver is available for your platform, as partial solution) what the Firebird format is.... They have about mainstream solutions.
-
I am certainly not starting a firebird flame all over again, but if you want interoperability with mainstream other applications plz do not choose Firebird for embedded. Use Sqlite for embedded.
Otherwise: if that's not important, firebird is an option as an embedded solution.
For larger projects I would never ever go with Firebird, because it is definitely not a mainstream solution and might get you into trouble with maintenance and interoperability with other software, like f.e. spreadsheets. These do not have a clue (ODBC if and when a driver is available for your platform, as partial solution) what the Firebird format is.... They have about mainstream solutions.
I am not disagreeing with what you say.
Sqlite and firebird both made their appearance in the year 2000
Given firebird's unique ability to function in both embedded and server modes it seems a pity
that sqlite achieved broader adoption.
Is there something inherently better about sqlite than Firebird or was it just luck?
-
I am not disagreeing with what you say.
Sqlite and firebird both made their appearance in the year 2000
Given firebird's unique ability to function in both embedded and server modes it seems a pity
that sqlite achieved broader adoption.
Is there something inherently better about sqlite than Firebird or was it just luck?
SQLite is usable under mobile platforms, and FBSQL only under major operating systems. I believe that is the reason for broader adoption.