title: Delphi map database table as class
body: <p>A friend of mine asked me how he can at runtime to create a class to 'map' a database table. He is using ADO to connect to the database. </p>
  
  <p>My answer was that he can fill an ADOQuery with a 'select first row from table_name', set the connection to database, open the query, and after that by using a cycle on the ADOQuery.Fields he can get FieldName and FieldType of all the fields from the table. In this way he can have all the fields from the table and their type as members of the class. </p>
  
  <p>There are other solutions to his problem?</p>