Insert data into database [Delphi]
You can also use the TADOCommand component, and have it execute the specific SQL command. If you find yourself performing the same command over and over again (like inserts into a table) then consider using parameters rather than directly changing the SQL for every call. Parameters are easy to use, just place a :PARAMNAME in your sql, then use the parameters object on the ado component your using to set the value. For example:
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, then the string "TEST" would be written to FIELD1.