CDbColSet Class Reference

#include <d32dbms.h>

Link against: edbms.lib

class CDbColSet : public CBase

Inherits from

  • CDbColSet

    Detailed Description

    Manages a set of column definitions which describe a table or rowset structure. Column definitions can be added and removed. The set can be iterated over, and ordinals for a column can be looked up.

    The class is not intended for user derivation.

    Constructor & Destructor Documentation

    CDbColSet ( )

    IMPORT_CCDbColSet()

    Constructs an empty column set.

    ~CDbColSet ( )

    IMPORT_C~CDbColSet()

    Frees resources owned by the object.

    Member Function Documentation

    AddL ( const TDbCol & )

    IMPORT_C CDbColSet &AddL(const TDbCol &aCol)

    Adds a column to the column set.

    ParameterDescription
    aColThe column to add to the set.

    Returns: A reference to this object.

    Clear ( )

    voidClear()[inline]

    Removes all of the columns from the column set.

    Col ( const TDesC & )

    IMPORT_C const TDbCol *Col(const TDesC &aColName)const

    Returns a named column definition in the set. If such a column does not exist in the set NULL is returned.

    ParameterDescription
    aColNameThe name of the column to find.

    Returns: A pointer to the column definition found, or NULL.

    ColNo ( const TDesC & )

    IMPORT_C TDbColNoColNo(const TDesC &aColName)const

    Returns the ordinal for a particular column name in this column set. If such a column does not exist in the set the special ordinal KDbNullColNo is returned.

    This function is particularly important when accessing data through a rowset. If the set of columns to be returned by a rowset is not explicitly specified, no assumptions should be made about the ordering of the columns returned. In such a case, in order to access the column data a column ordinal is required, and this can be obtained by using this function on the column set returned by RDbRowSet::ColSetL().

    ParameterDescription
    aColNameThe name of the column to find.

    Returns: The ordinal number of the column.

    Count ( )

    TInt Count()const [inline]

    Returns the number of column definitions in the set.

    Note that using a TDbColSetIter is another way to iterate through the contents of a CDbColSet.

    Returns: The number of columns in the columns set.

    NewL ( )

    IMPORT_C CDbColSet *NewL()[static]

    Constructs a new empty column set and returns a pointer to it.

    Returns: A pointer to the column set object.

    NewLC ( )

    IMPORT_C CDbColSet *NewLC()[static]

    Constructs a new empty column set and returns a pointer to it placing the pointer onto the cleanup stack. This allows the column set object and allocated resources to be cleaned up if a subsequent leave occurs.

    Returns: A pointer to the column set object.

    Remove ( const TDesC & )

    IMPORT_C voidRemove(const TDesC &aColName)

    Removes the named column from the set.

    ParameterDescription
    aColNameThe name of the column to remove from the set.

    operator[] ( TDbColNo )

    const TDbCol &operator[](TDbColNoaCol)const [inline]

    Returns a column definition by its ordinal number in the set.

    Note that using a TDbColSetIter is another way to iterate through the contents of a CDbColSet.

    ParameterDescription
    aColThe ordinal number of the column in the set. Columns in a column set are numbered from 1 to Count(), unlike Symbian OS array classes. Ordinal 0 is reserved to represent the invalid column number KDbNullColNo.

    Returns: The column definition requested.