I have written the following SQL to add a field to an Access table at runtime.
////Get field name
//Add field to table
Data.QPrices2.SQL.Add('ALTER TABLE XXX');
Data.QPrices2.SQL.Add('ADD ' +field+ ' Float');
This works fine, except when the field already exists when Delphi issues an error message.
I therefore need to change the SQL so that the program doesn't try to add a field that already exists.
I believe there is SQL syntax IF NOT EXISTS that might do the trick but how I use it in the above is a mystery.