MDAC 2.5 SDK - OLE DB Providers
Cursor Service for OLE DB


 

Creating Local Rowsets with the Cursor Service

See Also                    Related Topics

The Cursor Service allows you to create a stand-alone rowset by first defining the column information associated with the rowset and then opening it. Local rowsets can be used as data buffers or to hold and share local temporary data in an application. Indexes can be created on local rowsets to support sort, filter, and find operations. All data-manipulation operations are available on local rowsets.

The following code sample shows the creation of a Recordset object (and the underlying rowset), defining the columns and assigning values to each:

Private Sub CreateRs_Click()
   Dim rsNew As New ADODB.Recordset

rsNew.Fields.Append "job_id", adSmallInt
   rsNew.Fields.Append "job_desc", adVarchar
   rsNew.Fields.Append "min_lvl", adTinyInt
   rsNew.Fields.Append "max_lvl", adTinyInt
rsNew.Open
   
rsNew.AddNew
   rsNew.Fields("job_id").Value = 100
   rsNew.Fields("job_desc").Value = "GPM"
   rsNew.Fields("min_lvl").Value = 12
   rsNew.Fields("max_lvl").Value = 15
rsNew.Update
End Sub