This is a one-form sample that demonstrates how ADOCE is implemented in an application. The application allows you to open and modify tables and send SQL statements to a recordset. You can enter the name of a table to open or a SQL statement in the top field. When you click the Execute button, the string that is entered in the field is passed to the recordset.Open method as the Source parameter. When a record is opened, up to four fields of that record will be displayed in the four fields in the middle of the form. The AddNew button demonstrates the use of the AddNew method and the Delete button demonstrates the use of the Delete method.
The Record Management field displays the index of the currently active record. The four buttons provide navigation through the recordset using the Move… methods. The inner buttons move forward and backward one record, the outer buttons move to the beginning and end of the recordset. The error message box displays any errors that occur while accessing the recordset. A value of zero in the Error Result text box indicates no error has occurred.
This sample runs without further modification.
This program is written in both Visual Basic and Visual C++ with Visual Studio 5.0. Both samples will run in Visual Studio 6.0
For more detail, see the comments in the source code.
This application can assist in troubleshooting SQL statements. Enter the statement into the top field and press ENTER. If the SQL statement is not formed properly, an error message will appear in the Error Result message box.