Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
How To Demo of ADO AddNew, Update, Delete, Find and Filter
Article ID: 193946 - View products that this article applies to.
This article was previously published under Q193946
ActiveX Data Objects (ADO) implements record manipulation commands analogous to those found in the native FoxPro language.
The AddNew method adds a new, blank record to the end of the current Recordset. You use the Update method to write data to the Recordset. The Delete method removes the current record from the Recordset.
The Find and Filter methods allow you to search the Recordset for specific field values. Both methods support compound expressions.
The following example instantiates a Recordset from the AUTHORS table in the SQL Server PUBS sample database. The example demonstrates the AddNew and Update methods by adding a new record to the Recordset, uses the Find method to locate the new record and the Delete method to remove the new record. It then adds the same record again and uses the Filter property to locate and remove the record.
NOTE: Substitute the SERVER, UID and PWD parameters appropriate to your SQL Server installation in the Recordset.Open method.
In order to use this example, you must have Microsoft Data Access Components (MDAC) version 2.x or later installed, which is included in the data components of Visual Studio 6.0 or can be downloaded from the following Web address:
Article ID: 193946 - Last Review: July 1, 2004 - Revision: 4.3