Jump to content
Nektarios

Newbie wants to start a simple database

Recommended Posts

I am total new in Delphi. I have read some books about creating applications using simple VCL components.

I want to create a database app (using TDBGrid ?) form scratch.   I downloaded Delphi 12.

How can I make DBGrid work like Excel ?   

I want the user to enter the data in the grid and then on another form if she/he search for something the program should return a result from a record file.

If she/he close the app and opens it again she/he could see that the machines she/he entered are there.

All the videos, tutorials, books are assuming that there is a database file created in Microsoft Access or something like that. I don't want that. I want the user to create and manipulate the data by using my app only.

Is the solution a .dat file ?

Example:

Name          |   Power (kW)   |  Manufacturer        |  Year of installation

Machine 1   |     5                 |  Apple                     | 2015

Machine 2   |     3                 |  Seagate                 | 2019
Machine 3   |     2                 |  Microsoft              | 2022

Machine 4   |     3                 |  Apple                    | 2018

Machine 5   |     1                 |  Seagate                | 2019

Machine 6   |     3                 |  Apple                   | 2023


To read data in another form i want the user to ask for something (example: Machinery installed after 2021) and to display it in another table.

Name          |   Power (kW)          |  Manufacturer      |  Year of installation

Machine 3   |     2                        |  Microsoft             | 2022

Machine 6   |     3                        |  Apple                  | 2023

 

Finally, are there any books I can read about databases in Delphi, without using 3d party software like Microsoft Access ?  

 

 

Edited by Nektarios

Share this post


Link to post

There are a lot of resources available, if you search for them.

 

https://www.google.com/search?q=delphi+database+books

https://en.delphipraxis.net/topic/4965-delphi-books/

 

You will have to use a database engine of some form, and there are several to choose from. Below is a short list that are free to use.

 

Do not require install of a database server:

https://www.sqlite.org/

Also look at https://docwiki.embarcadero.com/RADStudio/Athens/en/Local_SQL_(FireDAC) (which uses SQLite)

https://docs.huihoo.com/firebird/manual/ufb-cs-embedded.html

 

Database servers:

https://www.mysql.com/

SQL Server Express

https://www.postgresql.org/

 

Share this post


Link to post
9 hours ago, Nektarios said:

All the videos, tutorials, books are assuming that there is a database file created in Microsoft Access or something like that. I don't want that. I want the user to create and manipulate the data by using my app only.

If you want to prevent others accessing the data input in the application, you can encrypt a SQLite3 database and data will not be able to read by other software unless your encryption key and method is found.

https://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.SQLite_Encryption_Sample

 

There are a lot to consider for saving data to disk file or reading from it. A database system already handles these for you.

Share this post


Link to post

if all you want is to read/write/search a list of machines then I would do a text file with comma separated values for each machine record and then use either an array of records or an in memory dataset to view/edit/add/delete/search.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×