dblistview TacDBListView component
Hierarchy Properties Methods Events
Return to Introduction  Previous page  Next page
Overview
The acDBListView is the database-aware version of acListView component. Were added just one property — DataSource. When you select the active data source which points to some TQuery component, the acDBListView will be filled with fields / records, accordingly to the SQL query. However the acDBListView can be used just for displaying database records, not for editing.  

How to use?
Just select the TQuery or any its third-party replacement in the DataSource property and the ListView will be filled with values accordingly to the SQL statement specified in the TQuery. Then just add required number of columns using property editor of Column property.  
 
tip For example, you have some table. Let's suppose, "users", which contains some personal information about your customers. There is two fields with usernames and passwords ("username" and "password") and you wish to show these fields using acDBListView.  
 
Then just specify following SQL statement to the TQuery:  
SELECT username,password FROM users  
and set Active property of TQuery to True.  
 
Or another advanced example: you wish to change order of columns, add some new field (i.e: email address, "email" field) + only select users which has subscribed ("subscribe" field) to some mailing list.  
Specify following SQL statement to TQuery:  
SELECT email,password,username FROM users WHERE subscribe="Y"  
Then activate TQuery and don't foget to set the columns accordingly to selected fields.  

See also
acListView component.