Basic usage
Some basic steps are required in order to be able to access and manipulate data using ADO :
1. Create a connection object to connect to the database.
2. Create a recordset object in order to receive data in.
3. Open the connection
4. Populate the recordset by opening it and passing the desired table name or SQL statement as a
parameter to open function.
5. Do all the desired searching/processing on the fetched data.
6. Commit the changes you made to the data (if any) by using Update or UpdateBatch methods.
7. Close the recordset
8. Close the connection
ASP example
Here is an ASP example using ADO to select the "Name" field, from a table called "Phonebook", where a
"PhoneNumber" was equal to "555-5555".
dim myconnection, myrecordset, name
set myconnection = server.createobject("ADODB.Connection")
set myrecordset = server.createobject("ADODB.Recordset")
myconnection.open mydatasource
myrecordset.open "Phonebook", myconnection
myrecordset.find "PhoneNumber = '555-5555'"
name = myrecordset.fields.item("Name")
myrecordset.close
set myrecordset = nothing
set myconnection = nothing