Home |Login| Search |  Newsletter 
English Russian
Devrace FIBPlus is a fast, flexible and high-performance component library for Borland® Delphi" 5-7, Borland® C++ Builder 5-6 and Borland® Kylix" 3 intended for work with Borland® InterBase® and Firebird using direct InterBase API. FIBPlus combines simplicity of architecture with development convenience that enables to create powerful and effective applications. FIBPlus allows use of all InterBase features and benefits: array-fields, blob-fields, generators and full control of transactions, support of all standard and third-party visual db-aware components, special features for optimization of InterBase net-traffic and a set of special design-time experts.


Products


Support


Download


Online shop


Press-releases


About company
  DEVRACE FIBPLUS
Printable

FIBPLUS

News, Events

Feature Matrix
System Requirements
Benefits
Free Trial Download

White Papers
Who uses FIBPlus
Testimonials
Screenshots

Order Now!
Geography of sales

FAQ
HelpDesk
Bug Tracker
Newsgroups

Feedback

GENERAL

Free download
Online shop
Support

COMPANY

About us
Partners
Press releases
Contact us


Devrace is Borland Technology Partner

We are member of Firebird community


Powered by Bitrix Site Manager - Content Management & Portal Solutions
Powered by Bitrix Site Manager - Content Management & Portal Solutions


FIBPlus. Master-detail. Step 5. Customizing master-detail mechanism.

Viewed: 507
Author: Serg Vostrikov

Step 5. Customizing master-detail mechanism.

FIBPlus also allows setting some peculiarities of master-detail mechanism work. As you remember in particular in our example we have opened the detail-dataset (pFIBDataSet2) manually. It is simple if we deal with a simple link, but if we use several master-detail links or longer links (master-detail-subdetail), manual opening of all queries can cause an error. You must always open a detail query after the main one. For avoiding unnecessary coding TpFIBDataSet contains a special DetailOptions property:

Figure 15.

If setting the dcForceOpen key we can be completely sure that the detail-query will be automatically open after opening the master-query. Now we can delete the pFIBDataSet2.Open string form our program. Whatever the complexity of master-detail links is, all the queries will be open in the necessary order.

The second important option is the dcWaitEndMasterScroll key. Imagine that a user is navigating on DBGrid1 trying to find a necessary department. With each his movement when the current record in DBGrid1 changes, pFIBDataSet2 automatically reopens the query. It is obvious that navigation on the master-table will cause a number of rather complex queries, which will considerably increase the net-traffic. In practice we needed to reopen the detail-query only once when the user has finally found the department in DBGrid1. FIBPlus helps to avoid redundant queries. If the dcWaitEndMasterScroll key is added to DetailConditions, the detail-query will reopen only after some interval (the interval value can be regulated by setting values of WaitEndMasterInterval).

Thus when the user simply navigates on DBGrid1, the change of the current record activates the timer of the detail-query. If during the interval the user has time to pass on to another record, the timer will be restarted. This will happen until the user stops on the necessary record. The detail query reopens only after this and that means that pFIBDataSet2 executes only one query instead of a series of them.

Conclusion

Now you know how FIBPlus master-detail links work, how to connect to the database, execute a select query and generate modifying ones, work with data in the context of two transactions and link master and detail datasets. Though the described approach is very simple we recommend you to study the examples thoroughly.

Return to the list


Opinions

* Put your opinion here.
* This dialog does not support HTML.

Your name: 

Return to the list



Feedback Site map FAQ Contact us
Legal Notices :: Privacy Policy