title: How do you add a lookup field to a dataset?
body: <p>I've got a dataset that I need a lookup field for.  Problem is, this dataset's structure is defined by the result of a query.  I can't add the field as a TFieldDef before setting <code>.Active = true;</code> because it gets overwritten, and I can't add it <em>after</em> running the query because you can't alter the structure of an open dataset.</p>
  
  <p>There has to be some way to do this.  Does anyone know how?</p>
  
  <p>EDIT:  There seems to be some confusion about what I'm looking for. I'm not looking for a lookup at query time. I'm looking for a <strong>lookup field</strong>, a TField object where FieldKind = fkLookup, so that it can be used with a data-aware lookup combo box, for editing the data after the query has returned its result. This has nothing whatsoever to do with the SQL and everything to do with Delphi's dataset model and data-aware controls.</p>