Class to represent database table cursors used in ODBC. More...
#include <rvc/dbtable.h>
Public Types | |
| enum | FUNCTION { FUNCTION_None = 0x00000000, FUNCTION_Unique = 0x00000001, FUNCTION_Sorted = 0x00000002, FUNCTION_Equal = 0x00000004, FUNCTION_GreaterThan = 0x00000008, FUNCTION_LessThan = 0x00000010, FUNCTION_NotEqual = 0x00000020, FUNCTION_AND = 0x00000040, FUNCTION_OR = 0x00000080, FUNCTION_NoClear = 0x00000100, FUNCTION_ForUpdate = 0x00000200 } |
| enum | INDEXFLAG { INDEXFLAG_None = 0, INDEXFLAG_IndexOffset = 0x00000001, INDEXFLAG_LeaveRunBit = 0x00000002 } |
Public Member Functions | |
| CURSOR (const RVC::DBTABLE &table) | |
| ~CURSOR () | |
| ERRVALUE | GetBookmark (BOOKMARK &Bookmark) const |
| ERRVALUE | GetIndex (INT32 &Index, INDEXFLAG flags=INDEXFLAG_None) const |
| DEPRECATED INT32 | GetRecordNum () const |
| bool | IsDone () const |
| bool | IsValid () const |
| int | Next () |
| bool | operator== (const CURSOR &rhs) const |
| ERRVALUE | Rewind () |
| INT32 | SeekValue (INT32 FieldNum, const MISTRING &value) |
| INT32 | SeekValue (INT32 FieldNum, const void *vbuf, const FIELDINFO *finfo, bool bSingleField=true) |
| ERRVALUE | SetFunction (INT32 FieldNum, FUNCTION Function) |
| ERRVALUE | SetSort (const SIMPLE_ARRAY< INT32 > &FieldList) |
Class to represent database table cursors used in ODBC.
| RVC::DBTABLE::CURSOR::CURSOR | ( | const RVC::DBTABLE & | table | ) | [explicit] |
Default constructor.
| RVC::DBTABLE::CURSOR::~CURSOR | ( | ) |
Destructor.
Get the offset into the rowset Note that INDEXFLAG_LeaveRunBit is meaningless for ODBC and OLE DB.
| DEPRECATED INT32 RVC::DBTABLE::CURSOR::GetRecordNum | ( | ) | const |
Get the current record number or < 0 if error.
| bool RVC::DBTABLE::CURSOR::IsDone | ( | ) | const [inline] |
| bool RVC::DBTABLE::CURSOR::IsValid | ( | ) | const |
Is the cursor valid.
| int RVC::DBTABLE::CURSOR::Next | ( | ) |
Increment cursor.
RVC::DBTABLE::CURSOR Cursor(Table); while (Cursor.Next() > 0) { ... }
| bool RVC::DBTABLE::CURSOR::operator== | ( | const CURSOR & | rhs | ) | const |
Equality.
| ERRVALUE RVC::DBTABLE::CURSOR::Rewind | ( | ) |
Reset cursor to the beginning Note: After calling Rewind, the cursor is actually pointing one record before the beginning.
It is intended that you should use it like this...
RVC::DBTABLE::CURSOR Cursor(Table); ... Cursor.Rewind(); // only necessary if you've already used Cursor while (Cursor.Next() > 0) { ... }
Seek to a spot in the table.
| INT32 RVC::DBTABLE::CURSOR::SeekValue | ( | INT32 | FieldNum, | |
| const void * | vbuf, | |||
| const FIELDINFO * | finfo, | |||
| bool | bSingleField = true | |||
| ) |
Seek to a spot in the table.
Set cursor behavior Note: the only functions that will work with this method are Sort and Unique.
Sort has its own function which is better.
| ERRVALUE RVC::DBTABLE::CURSOR::SetSort | ( | const SIMPLE_ARRAY< INT32 > & | FieldList | ) |
Set cursor behavior.
| FieldList | fields to sort on |
1.6.1