Index

DXResultSetCursorV4

Purpose:

This is the class that is used to represent a result set cursor for VisualInfo for AS/400.

Methods:

isValid
        BOOL isValid();

Returns true if the cursor is valid. The cursor is valid if it is pointing to a data object or if it is positioned at the beginning, end or in between.

isOpen
        BOOL isOpen();

Returns true if the cursor is open.

isBegin
        BOOL isBegin();

Returns true if the cursor is positioned at the beginning, that is, if it is positioned before the first data object in the result.

isEnd
        BOOL isEnd();

Returns true if the cursor is positioned at the end, that is, if it is positioned after the last data object in the result.

isInBetween
        BOOL isInBetween();

Returns true if the cursor is positioned in between data objects in the result set. In other words, the cursor is not at the beginning or at the end, and the current data object has not been fetched.

getPosition
        long getPosition();

Gets the current position of the cursor.

setPosition
        setPosition(long repositionType, VARIANT value);

Sets the cursor to the specific position. The valid reposition types are:

DX_V4_NEXT
Next data object from the current position.

DX_V4_RELATIVE
Relative position in the result set from the current position as indicated by value.

setToNext
        setToNext();

Sets the cursor to point to the position of the next data object.

fetchObject
        LPDISPATCH fetchObject();

Fetches the element of the result set at the current position and returns it as a DXDDOV4. The returned LPDISPATCH pointer contains a DXDDOV4 object.

fetchNext
        LPDISPATCH fetchNext();

Fetches the next element of the result set and returns it as a DXDDOV4. The returned LPDISPATCH pointer contains a DXDDOV4 object.

fetchNextN
        BOOL fetchNextN(long how_many, LPDISPATCH       collection);

Fetches the next N elements of the result set and insert them into the given collection. Returns true if there is at least one data object returned. The input parameter LPDISPATCH pointer contains a DXSequentialCollectionV4 object.

fetchObjectByName
        VARIANT fetchObjectByName(LPCTSTR    

Fetches a value of the the data object by data item name.

fetchNextByName
        VARIANT fetchNextByName(LPCTSTR dataItemName);

Fetches the value of the the next data object by data item name.

fetchNextNByName
        BOOL fetchNextNByName(LPCTSTR dataItemName, long how_many, 
                              VARIANT* array, long arraySize);

Fetches the values of the the next n data objects by data item name and insert them into the given array. The size of array and how_many input parameter determine how many values are put into the array. Returns true if there is at least one value returned.

findObject
        LPDISPATCH findObject(long position, LPCTSTR predicate);

Finds the data object which satisfies the given predicate, move the cursor to that position, fetches and returns the data object. The returned LPDISPATCH pointer contains a DXDDOV4 object.

The format of the predicate string is AttrName RelOp Value where RelOp are relational operators such as =, ==, <=, >=, <, or >.

open
        open();

Opens the cursor.

close
        close();

Closes the cursor.

destroy
        destroy();

Destroys the result set cursor. This method allows for cleanup.

datastoreName
        BSTR datastoreName();

Gets the datastore name.

datastoreType
        BSTR datastoreType();

Gets the datastore type.

cardinality
        long cardinality();

Returns the number of results.

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.