1. Home
  2. Computing & Technology
  3. Delphi Programming

Data Browsing and Navigation in Delphi Database Applications

By Zarko Gajic, About.com

6 of 6

Let There Be Data Editing Delphi Form

Ok, all set up. Everything we have to do now is to activate the connection and scroll through the records. The Active property of a dataset component (ADOTable1) indicates whether we have a live connection to the table or not. Setting Active to True or calling the Open method sets the Connected property of the ADOConnection1 to True - and displays the data in related data-aware controls.

First, Move by, Last,...

You are finally ready for some action. The next step is to see how to "walk" through the recordset.

The DBNavigator component gives a simple and friendly tool for navigating through the recordset. In addition to it's navigational abilities, the DBNavigator provides means for manipulating the data with actions like Insert, Delete or Cancel the changes. For example, if the we click the Delete button, the correct record is deleted from the DBGrid - and from tabase table! Each button is optional and you can mix and match at will.

Using the buttons set you can skip to the last record or move to the previous one. For example, clicking on the Last button sets the current record to the last record in the recordset and disables the Last and Next buttons. Clicking the Last button is functionally the same as calling the Last method of a dataset.

Note that one of the navigational operations that the DBNavigator cannot process is moving forward or backward in a recordset by a number or records. The MoveBy method of a dataset is used to position the cursor on a record relative to the active record in the recordset.

That's it for this chapter. We are now ready to move on to topics like editing and searching the recordset, expect to learn about that in the following chapters of this course...

Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Build Database Applications
  5. Data Browsing and Navigation in Delphi Database Applications - Data Form

©2009 About.com, a part of The New York Times Company.

All rights reserved.