Recent

Author Topic: STARTING WITH DATABASES  (Read 6423 times)

elico

  • New member
  • *
  • Posts: 5
STARTING WITH DATABASES
« 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

mirce.vladimirov

  • Full Member
  • ***
  • Posts: 220
Re: STARTING WITH DATABASES
« Reply #1 on: October 28, 2015, 10:20:16 pm »
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

Old_Dog

  • New Member
  • *
  • Posts: 28
Re: STARTING WITH DATABASES
« Reply #2 on: October 28, 2015, 10:33:59 pm »
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.

elico

  • New member
  • *
  • Posts: 5
Re: STARTING WITH DATABASES
« Reply #3 on: October 29, 2015, 10:03:13 am »
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

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 917
    • Burdjia
Re: STARTING WITH DATABASES
« Reply #4 on: October 29, 2015, 01:20:55 pm »
Did you read the tutorials or saw the videos they linked?  They explains what you need.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Old_Dog

  • New Member
  • *
  • Posts: 28
Re: STARTING WITH DATABASES
« Reply #5 on: October 29, 2015, 04:20:34 pm »
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.
 

Old_Dog

  • New Member
  • *
  • Posts: 28
Re: STARTING WITH DATABASES
« Reply #6 on: October 29, 2015, 07:08:53 pm »
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

kapibara

  • Hero Member
  • *****
  • Posts: 516
Re: STARTING WITH DATABASES
« Reply #7 on: October 29, 2015, 07:27:24 pm »
@elico: Are you going to work with SQL at all? Or do you intend to use flat files as "databases"?
Lazarus trunk / fpc 3.0.4 / Debian 10 - 64 bit

elico

  • New member
  • *
  • Posts: 5
Re: STARTING WITH DATABASES
« Reply #8 on: October 29, 2015, 10:08:44 pm »
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

elico

  • New member
  • *
  • Posts: 5
Re: STARTING WITH DATABASES
« Reply #9 on: October 29, 2015, 10:25:29 pm »
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

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 753
Re: STARTING WITH DATABASES
« Reply #10 on: October 29, 2015, 11:51:44 pm »
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
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

mirce.vladimirov

  • Full Member
  • ***
  • Posts: 220
Re: STARTING WITH DATABASES
« Reply #11 on: October 30, 2015, 12:06:27 am »
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.
« Last Edit: October 30, 2015, 12:15:38 am by mirce.vladimirov »

talorigomat

  • Jr. Member
  • **
  • Posts: 96
Re: STARTING WITH DATABASES
« Reply #12 on: October 30, 2015, 11:34:57 am »
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
« Last Edit: October 30, 2015, 11:41:21 am by talorigomat »
Lazarus 1.8.0Rc4, Windows 10

Thaddy

  • Hero Member
  • *****
  • Posts: 9167
Re: STARTING WITH DATABASES
« Reply #13 on: October 30, 2015, 12:04:26 pm »
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.
« Last Edit: October 30, 2015, 12:08:04 pm by Thaddy »
also related to equus asinus.

Old_Dog

  • New Member
  • *
  • Posts: 28
Re: STARTING WITH DATABASES
« Reply #14 on: October 30, 2015, 02:05:27 pm »
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?
« Last Edit: October 30, 2015, 02:15:54 pm by Old_Dog »