OpenRecordset, Edit, Update Methods Example (VC++)

This example edits and updates the first and last names of a selected record.

See How to Build the DAO Method Samples.

On the MSDN Library discIf you have installed the DAO SDK, see Samples\dbdaoInstallDirectory\DAOSDK\SAMPLES\Edit.cpp.

Note Sometimes using SQL can be the most efficient way to perform a task. For example, you could use the following code to locate each record whose Title field satisfies the search criteria and then change the job title.

CString strSQL = _T("Update Employees Set Title = 'Account Executive' WHERE Title = 'Sales Representative' ");
dbsNorthwind.Execute( strSQL );