Platform SDK: Broadcast Architecture

CDatabaseRecordset::OpenRecordset

The OpenRecordset method opens the specified recordset in the Guide database. C syntax is shown.

BOOL OpenRecordset(
  LPCTSTR WhereBy,
  LONG lType
);

Parameters

WhereBy
SQL WHERE clause that specifies the criteria for the recordset to open. Only records that match these criteria are opened.
lType
Optional parameter that specifies whether the Jet database engine opens the recordset as a snapshot or a dynaset. This parameter can be one of the following values.
Value Meaning
dbOpenSnapshot     Open the recordset as a snapshot, in other words as a fixed copy of the records in the table.
dbOpenDynaset Open the recordset as a dynaset, in other words as a set of pointers to the records in the table. The dbOpenDynaset value is the default.

Return Values

Returns TRUE if the recordset was successfully opened, and FALSE otherwise.

Remarks

You can reuse recordset objects by opening and closing a single recordset object multiple times. Doing so is more efficient than deleting and creating a new instance of a recordset object.

The record count within a recordset is not automatically defined when your application opens the recordset unless your application uses a SQL ORDER BY clause. If your application does not use ORDER BY, it can determine record count by calling theGetRecordCount method after calling OpenRecordset. However, GetRecordCount must move to the last record in the set. This movement can be slow for large recordsets. Use of the SQL ORDER BY clause sets the correct record count as part of the indexing process.

In the case of large recordsets, opening the recordset as a snapshot can degrade performance.

Requirements

  Windows NT/2000: Unsupported.
  Windows 95/98: Requires Windows 98.
  Header: Declared in dbsets.h.
  Import Library: Use dbsets.lib or dbsetsst.lib.

See Also

CDatabaseRecordset::GetRecordCount