2009. július 15., szerda

Easy way of creating a database application


Problem/Question/Abstract:

How can you create a database application without manually putting the visual components like DBEdit, DBImage etc., and attach that with a field in the table and setting other properties?

Answer:

You don’t need to write a single line of code for this. All starts with the TTable component.

Let me tell you the steps needed to do this:

Create a new application.
Put a TTable component on the form
Set the database and table name properties
Right click on the TTable component, you will be getting a menu
Select Fields editor
You will be getting a grid
Then right click on the fields Editor.
You will be getting another menu
Then you can either select the Add Fields or Add all fields option.
If you select Add all fields option, all the fields in the table will be added to the fields editor.
Then you just select the fields you want to show up on the form.
Then just drag all the fields on to the form; you are done.
Yes you will be getting the respective DBEdit,DBImage etc., on the form.
Also the datasource component will be added.
For navigation, you can put a Navigator control from the DataControls palette and assign the datasource property for it.
Now the simple database application is ready to use.
You can run the application and work with all the database operations like navigation, edit etc., thro’ the navigator.

For Delphi beginners, this could be enough to start with database application.

The same thing you can do with putting separate control like DBEdit etc., and setting the properties;but here you dont need to set any properties for those controls; all will be set automatically once you drag the fields from the fields editor onto the form.

Nincsenek megjegyzések:

Megjegyzés küldése