Edit

Share via


CTable Class

Provides a means to directly access a simple rowset (one with no parameters).

Syntax

template <class TAccessor = CNoAccessor,
            template <typename T> class TRowset = CRowset>
class CTable :
   public CAccessorRowset <TAccessor, TRowset>

Parameters

TAccessor
An accessor class.

TRowset
A rowset class.

Requirements

Header: atldbcli.h

Members

Methods

Name Description
Open Opens the table.

Remarks

See CCommand for information on how to execute a command to access a rowset.

CTable::Open

Opens the table.

Syntax

HRESULT Open(const CSession& session,
   LPCWSTR wszTableName,
   DBPROPSET* pPropSet = NULL,
   ULONG ulPropSets = 0) throw ();

HRESULT Open(const CSession& session,
   LPCSTR szTableName,
   DBPROPSET* pPropSet = NULL,
   ULONG ulPropSets = 0) throw ();

HRESULT Open(const CSession& session,
   DBID& dbid,
   DBPROPSET* pPropSet = NULL,
   ULONG ulPropSets = 0) throw ();

Parameters

session
[in] The session for which the table is opened.

wszTableName
[in] The name of the table to open, passed as a Unicode string.

szTableName
[in] The name of the table to open, passed as an ANSI string.

dbid
[in] The DBID of the table to open.

pPropSet
[in] A pointer to an array of DBPROPSET structures containing properties and values to be set. See Property Sets and Property Groups in the OLE DB Programmer's Reference in the Windows SDK. The default value of NULL specifies no properties.

ulPropSets
[in] The number of DBPROPSET structures passed in the pPropSet argument.

Return Value

A standard HRESULT.

Remarks

For more details, see IOpenRowset::OpenRowset in the OLE DB Programmer's Reference.

See also

OLE DB Consumer Templates
OLE DB Consumer Templates Reference