SQL general question lazarus / 16-Databases ---------------------------------------------------------------------- Pascaluvr · 2012-03-28 15:41 I currently have an application that uses Isam files and so the data is stored in records.  So, in simple terms, I read in a record and assign the fields to my Form.  The fieldnames in the form and the record are the same, so I don't make too many mistakes in this area, and of course, it is obvious what I'm doing if you read the code. What do people do in SQL?  I can see me making endless mistakes assigning SqlQuery.Fields[index].AsString to a Form.  Also, if I add another field to my Select statement ( anywhere except the end) my Index will be wrong.  I am sure that someone has come up with a clever way to handle this - but I can't think what it may be. ---------------------------------------------------------------------- sfeinst · 2012-03-28 16:45 In code, you would use FieldByName('fieldname') to access result set columns.  As you have guessed, using the index when trying to access a specific column is not a great option because you might change your sql. If you want to avoid writing the code, you can use data-aware controls instead which do all of this for you.  Soem people dislike using data- aware controls.  I have done both, though I do tend towards non-data- aware apps.