CGXODBCGrid::SetRecordset

void SetRecordset(CRecordset* pSet);

pSet

A pointer to the CRecordset object to be displayed in the grid.

Remarks

Lets you attach the CRecordset object to be displayed in the grid.

See the attached example.

Example

This sample code shows a typical OnInitialUpdate method where a CRecordset is instantiated and attached to the grid.

void CGxqueryView::OnInitialUpdate()
{
   CGxqueryDoc* pDoc = GetDocument();
   if (pDoc->m_pParam == NULL)
   {
      // construct parameter object
      pDoc->m_pParam = new CGXDbParam;
   }
   // else
      // No data need to be initialized. They are already available in the document.
   // pass the pointer to the grid view
   SetParam(pDoc->m_pParam, FALSE);
  // ^-- indicates that document is responsible
                       // for deleting the object.
   // Attach the recordset object
   SetRecordset(m_pSet = pDoc->m_pQuerySet);
   // standard initialization, will create other objects
   // such as data object, stylesmap object, ... and open
   // the recordset
   CMyRecordView::OnInitialUpdate();
   // Enable Objective Grid internal update-hint mechanism
   EnableHints();
   // Note: You can use the Window|New command to open a new
   // view on the same cursor.
}

See Also

 CGXODBCGrid::OnGetRecordset

CGXODBCGrid

 Class Overview |  Class Members