Friday, March 3, 2017

Simple Database Application by Sofi Rahmatulloh

Simple Database Application by Sofi Rahmatulloh


Hy, reader, today the weather in my town is bad, but its okay. It cant beat my spirit to write this important articel. Today I share an articel named "How To Make A Simple Database Application".
In This articel I just explain the connection between delphi and ms acces.

Refer to the title "How To Make A Simple Database Application".
So, firstly we must to create database.
We make it by using microsoft access.
The steps are :

  1. Open the microsoft access.
  2. Make database, save using 2002-2003 (because its stabil).
  3. Make table. For the easiest way to make table use design view.
  4. When ms access ask to save, click save.
  5. Then, make some field of the table.
  6. Then save the table.
  7. Change to datasheet view, and fill your table.
  8. Save.
Now, we go to delphi.
First. Make ado connection, ado table, and data source like this picture. Both ado connection and ado table, you can find in ado tabs. And data source you can find in data access. Like this picture.
Simple Database Application by Sofi Rahmatulloh

Then, configure the ado connection. The configuration is in object inspector.
You may also click twice at ADO connection. So appear form like this picture :
Simple Database Application by Sofi Rahmatulloh

Then, click build, then it will appear form like this picture :
Simple Database Application by Sofi Rahmatulloh


Choose Micosoft Jet 4.0 OLE DB Provider, and click next.
And Click Test Connection, if success.
So appear form like this picture :


Simple Database Application by Sofi Rahmatulloh
 
You can also, rename your ADO Connection :

Simple Database Application by Sofi Rahmatulloh
As example, my ado connection I give name "koneksi".
Then, Click ADO table, In Object Inspector, change connection to be "koneksi", Cange name as you want, cange table name with your table at ms access.
Simple Database Application by Sofi Rahmatulloh

Then, Click data source. Cange data set to be "name of your ado table". And dont forget to give the name of your data source.
Like this picture :
Simple Database Application by Sofi Rahmatulloh

 The next step, you must create DBgrid, it can you find at data control tab.
Simple Database Application by Sofi Rahmatulloh
In DBGrid you can view all of data at your database.

Simple Database Application by Sofi Rahmatulloh
You should change dataSource to be source1 as the name of your data source.
Okey, from this step, you can look your database in DBGrid.
But DBGrid look untidy.
If you want your DBGrid look good looking.
You must configure DBGrid Column width.
Clict twice your DBGrid. Then right click and add all field. Click which column you wanna configure.
In column object inspector, change width. If you wanna cange column color, cange color in column object inspector.

Ok, Its all my articel today. Simple Database Application by Opimus Click. "How To Make A Simple Database Application". To be continued....



Available link for download