When your application needs to update data in an external data source, you can either execute direct SQL statements or use a Recordset object (and its various methods for modifying data). Using SQL statements works best when a large number of records need to be updated. Using SQL statements is also more efficient for both the client and the server.
You can use either a Connection object or a Command object to execute SQL statements directly. It is preferable to use a Connection object when the SQL command will be issued only once. If your application needs to send the same SQL command to the data source more than once, it is more efficient to use a Command object. Both objects use the Execute method to send the SQL command to the data source.
For more information on the Structured Query Language (SQL) syntax, read the article "Creating Basic Queries" in Platform SDK Help.
You can use the SQL Insert statement to issue a command that will add a new record (or group of records) in a data source.
To see sample code that executes an Insert statement using a Connection object, click this icon.
You can use the SQL Update statement to issue a command that changes a record or group of records.
To see sample code that executes an Update statement using a Connection object to change a student's major, or area of specialization, click this icon.
You can use the SQL Delete statement to issue a command that deletes a record or group of records in a data source.
To see sample code that executes a Delete statement using a Connection object to remove a record from the Books table, click this icon.