mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 16:39:19 +02:00
LazDoc - fix typos in HowToUseDataAwareControls
git-svn-id: trunk@13684 -
This commit is contained in:
parent
26a8d08b3b
commit
f8cc8d08d4
@ -4468,7 +4468,7 @@
|
||||
<descr>
|
||||
<p><i>HowToUseDataAwareControls</i> - Hints for accessing databases. A set of Data-Aware components is provided, to make it easier to access information held in databases.</p>
|
||||
<p>Before using Data-Aware components, it is necessary to make a connection with a database, and this should be done either using a TSQLConnection or a TDBf component, depending on the type of database that is being used. In any case, the components for connection with the database need to be found in $Lazdir/components/sqldb/, $Lazdir/components/tdbf/ or whatever other source is appropriate. They need to be added using the <i>Components</i> Menu Item of the IDE, and compiled ready for adding. The IDE needs to be re-built to include the new components.</p>
|
||||
<p>To make the connection with the database: first place a <i>DataBase Connection</i> on the Form (invisible at run-time, so put it anywhere convenient); set its properties to connect the user (with name and password) to the appropriate server, database and table (the connection component should deal with all the user-authentication issues, opening and closing the database etc). Then put on a <i>TDataSource</i> from the Data Access tab of the Component Palette, and perhaps items such as <p>TSQLTransaction</p> and <p>TSQLQuery</p>, depending on the particular database you are using. The various database components need to be linked to each other, for example by setting the <i>Transaction</i> property of a database connector to the appropriate transaction component, and linking the <i>DataBase</i> property of the Transaction component back to the database connector; link the DataSource's <i>DataSet</i> property to the appropriate SQLQuery or other set of data, and its <i>Transaction</i> property to the transaction component</p>
|
||||
<p>To make the connection with the database: first place a <i>DataBase Connection</i> on the Form (invisible at run-time, so put it anywhere convenient); set its properties to connect the user (with name and password) to the appropriate server, database and table (the connection component should deal with all the user-authentication issues, opening and closing the database etc). Then put on a <i>TDataSource</i> from the Data Access tab of the Component Palette, and perhaps items such as <i>TSQLTransaction</i> and <i>TSQLQuery</i>, depending on the particular database you are using. The various database components need to be linked to each other, for example by setting the <i>Transaction</i> property of a database connector to the appropriate transaction component, and linking the <i>DataBase</i> property of the Transaction component back to the database connector; link the DataSource's <i>DataSet</i> property to the appropriate SQLQuery or other set of data, and its <i>Transaction</i> property to the transaction component</p>
|
||||
<p>Each Data-Aware control (on the Data Controls tab of the Component Palette) has the usual set of properties to determine its shape and size, position, colour and font etc. But there are also special properties to define the data to be displayed or modified. These include the <i>DataSource</i> property which must be set to link to the defined set of data, and often a <i>Field</i> component to determine which of the columns in the database is to be displayed. </p>
|
||||
<p>Most of the components operate on a single Row or record of the database, but the <i>TDBGrid</i> is capable of displaying and operating on multiple rows and columns, in a <i>StringGrid</i> format, allowing the user to get an overview of what is in the database. The DBGrid will display the contents of the DataSet even at design time, provided the various components are enabled or rendered active; this allows the designer to ensure that all the connections to the database have been correctly made.</p>
|
||||
<p>The <i>TDBNavigator</i> component is used in conjunction with the Data-Aware components. It consists of a series of buttons to allow browsing through the DataSet, displaying the first, previous, next or last record (or Row), inserting or deleting records, committing the changes back to the database or refreshing the DataSet from the database.</p>
|
||||
|
Loading…
Reference in New Issue
Block a user