You are right of course, but I wanted to say that it also has to work with 'select *' and accessing fields by their indexes. If it doesn't, he made an error.
Of course, it is easier to maintain and have less errors if you use 'select field1, field2, ...' and then 'FieldByName('field1').AsString'.
Correct!
Though, Query.FieldByName('MyCharField') still works with "SELECT * FROM Table"
As a Rule of Thumb: Avoid ordinal/indexed Field-Access.
Your column is the 6th Column, you access it with Query.Fields[5],
and later another DBA INSERTS a new Column in Position 4, and KABOOM!
EDIT: To explain my aversion to "SELECT * FROM":
Imagine you have something like an Address-Book (or User-Accounts).
You use "SELECT * FROM" all through your code.
Everything looks nice.
On a sunny day, another developer decides: "Hey, let's add a BLOB-Column, so users can upload a picture of themselves"
I can guarantee your Hotline-phone will not stand still ("Why is the network so slow today?")
Another example is the company i work for: Our Mainframe is an IBM iSeries, which runs a DB2 with some 5000 Tables (Yes, you read it right: "Five
Thousand")
I often have to write queries spanning some 10-20 Tables (INNER JOIN, LEFT JOIN, ROW_NUMBERS, you name it), and it's a
RARITY in our System if a Table has
LESS (!!!) than 50 Columns.
Our recordholder is a Table with some 400 Columns......
Bottom Line: At the latest when you have to join multiple tables, a SELECT * FROM will blast your performance to smitherens