CdbRecordset::CopyQueryDef Method

Copies the QueryDef used to create the Recordset object (Microsoft Jet workspaces only).

Syntax

CdbQueryDefCopyQueryDef(VOID);

Remarks

The CopyQueryDef method returns a CdbQueryDef object variable that represents the QueryDef object you want to copy.

Usage

#include <afxole.h>
#include <dbdao.h>

CdbDBEngine      dben;
CdbRecordset    rst;
CdbDatabase      dbs;
CdbQueryDef      qd;
CString         strSQL = _T("SELECT * FROM PARTS");
...
dbs = dben.OpenDatabase(_T("Northwind.mdb"));
   // Get a recordset based on a query.
rst = dbs.OpenRecordset(strSQL);
   // Get a copy of the query that built the recordset.
qd = rst.CopyQueryDef();     // Copy the queryDef