This is the most commonly used component for Crud operations. Using DBTable does not require deep knowledge of SQL as this is fully generated. The only thing that might be necessary is the filtering, but the SQL builder is used for this purpose. To use it, put a DBTable on the form and connect it to the correct connection. The table property will contain all the available tables and you can drop-down to the required one. 


Other important properties are:


Autoincrement

If you have a field of type integer that is not set to autoincrement in the database then you can manually obtain the same result by defining the property here. PHsPeed will generate code to find the maximum value and then increment it by 1. Do not use if you have that field defined as autoinc in your database or use a database sequence.

Allows you to select which fields are shown and if applicable, what is the primary key. Some databases do not report the primary key because they use a unique index instead. In that case you need to define the primary key. Although you rarely would have to edit this form, it is always a good idea to verify if the fields are there. Especially when you change the fields in the database, you must open this form to apply the changes. Then these are passed to the datasource so that the new structure is available for the other database components as edits grids etc. 


Filter / Subfilter en Fixed filter

Filter: applies to the main table

SubFilter: applies to the cached results.


It is important to realize that filters are used to modify the sql statement, especially in the where clause. To prevent XSS issues please see: Development with individual DB components


Result…

Set No users will have the need to scroll through thousands of records to find the one they need. Search results are always limited to a maximum. By default the limit is set to 10000. You can change this, but a best practice is to set a valid select statement to limit the results. That saves resources, responsetime and brings a better user experience. 

Unfortunately, the syntax to limit the search result is not a standard in SQL. Therefore you must select the correct syntax in the IDE database definition.


Table

A list of tables to select from. There is an alternative way, and that is to open the database viewer and drag/drop the table on the component.