Page 265 - Open Soource Technologies 304.indd
P. 265

Unit 12: ADO Data Control



               12.1  Recordset and Field Objects

               The ADOCE control has two objects:  Recordset and  Field. A recordset is a virtual database table
               whose fields and rows correspond to a subset of the fields and rows in an actual database table
               on the Windows CE–based device. When you make additions, deletions, or changes to the
               information in a recordset row, you can pass those changes to the corresponding parts of the
               table. When you change data in the recordset, the recordset stores the changes in memory,
               enabling you to cancel them before the underlying database is updated. ADOCE does not support
               batch updates. Only one row at a time can have data that is changed but not committed to the
               underlying database.
                                Table 12.1: Methods that the Recordset object supports

                Method           Description

                AddNew           Inserts a new row into the recordset.
                CancelUpdate     Cancels changes0. held in memory.
                Clone            Duplicates a recordset.
                Close            Closes a recordset.
                Delete           Deletes a row from the recordset.
                GetRows          Returns data stored in the recordset.
                Move             Changes the pointer to the active row in the recordset.
                MoveFirst        Makes the first row active.
                MoveLast         Makes the last row active.
                MoveNext         Moves the active row pointer to the next row.
                MovePrevious     Moves the active row pointer to the previous row.
                Open             Defines and opens recordsets; runs SQL commands.
                Supports         Determines if the recordset supports certain features.
                Update           Commits changes held in memory and updates the actual table.


                               Table 12.2: Properties that the Recordset object supports
                Property         Description

                AbsolutePage     Specifies which page to move for a new current record.
                AbsolutePosition  Specifies the ordinal position of a  Recordset object’s current record.
                ActiveConnection  Sets the current database connection. Always a zero-length string (“”). For
                                 H/PC running Pro Edition software, the name of the cdb file.
                BOF              Indicates whether the current record position is before the first record in
                                 a  Recordset object.
                Bookmark         Specifies a bookmark that uniquely identifies a record in a Recordset object.
                CacheSize        Specifies the number of records from a  Recordset object that are cached
                                 locally in memory.



                                      LOVELY PROFESSIONAL UNIVERSITY                        259
   260   261   262   263   264   265   266   267   268   269   270