Table to Delphi DBGrid
Posted by webmaster Guido on April 11, 2003
In Reply to: table to DBGrid posted by sam sgling07 on April 08, 2003
: Can someone teach me how to transfer a table contenct into DBGrid. I only have a field
in a table.
1. Put a Delphi dataset-component on the form. The easiest one is a TTable, so use this for now. (also a TQuery can be used, but that's more complicated)
2. In Delphi's Object Inspector, set up the TTable component for the table that you are using.
3. Add a Delphi TDataSource to the form, and set its property DataSet to the TTable component; for example, Table1 if that's the name of your TTable.
4. Set the property DataSource of the DBGrid to the TDataSource, for example: DataSource1.
5. Set the property Active of the TTable to TRUE, either in the Object Inspector or in your code.