You can also use the TADOCommand component and execute a specific SQL command. If you repeat the same command over and over (for example, inserts into a table), consider using parameters instead of directly modifying SQL for each call. Parameters are easy to use, just put: PARAMNAME in your sql, then use the parameter object on the ado component that you use to set the value. For instance:
Assuming the CommandText of the TAdoCommand component contains " INSERT INTO TABLENAME (FIELD1) VALUES (:FIELDVALUE1) "
AdoCommand1.Parameters.ParamByName('FIELDVALUE1').Value := 'TEST' AdoCommand1.Execute;
When the above sql is executed, the string "TEST" will be written to FIELD1.
source share