Introducing ADOCE Objects

Team-Fly    

 
eMbedded Visual Basic: Windows CE and Pocket PC Mobile Applications
By Chris Tacke, Timothy Bassett
Table of Contents
Chapter 7.  Storing and Retrieving Data with ActiveX Data Objects CE


The first task in using ADOCE is to understand the object model. ADOCE is comprised of the Connection, Recordset, Field, Error, and Property objects and Errors, ErrorParameters, Fields, and Properties collections. The most commonly used are Connection, Recordset, Field, and Fields. The remaining objects have limited implementation and functionality in ADOCE.

The Connection Object

The Connection object is the root of using ADOCE. It's the means to getting to all the other objects and creating data definitions. The Connection object allows you to specify which data source to create and use.

The three most important methods and properties of the Connection object are ConnectionString, Open, and Execute.

The Recordset Object

The Recordset object contains the actual data. A Recordset object is populated via a couple of different methods:

  • The Connection.Execute method can create a new, already populated Recordset object. To create and populate a Recordset object using the Connection.Execute method, a SQL statement is issued to the Execute method as the source.

  • Use the Open method of the Recordset itself. Once a Recordset object is open, you can cycle through records, and access values of the fields.

The Recordset object allows programmatic control of moving forward and backward through the records, deleting records, adding records, and saving and setting bookmarks. The most important properties of the Recordset object are State and EOF. The Fields collection is widely used as well. The commonly used methods of the Recordset object are Open, MoveNext, Add, Delete, and Update.

The Fields Collection

The Fields collection is a collection of all columns within a Recordset. There is one Field object in the collection for each corresponding column in the data source. A Field object is also created within the Fields collection for each computed column in the SQL statement.

The Field Object

The Field object is a member of the Fields collection that allows access to the data column's value and properties. It allows the ability to read and write values to the column using the Value property, which in turn can be updated to the data store. Information about the column and the values of the Field object also can be determined via the object's Name , Type, and UnderlyingValue properties.


Team-Fly    
Top
 


eMbedded Visual BasicR. WindowsR CE and Pocket PC Mobile Applications
eMbedded Visual BasicR. WindowsR CE and Pocket PC Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2001
Pages: 108

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net