CDaoRecordset::GetSQL

CString GetSQL( ) const;

Return Value

A CString that contains the SQL statement.

Remarks

Call this member function to get the SQL statement that was used to select the recordset’s records when it was opened. This will generally be an SQL SELECT statement.

The string returned by GetSQL is typically different from any string you may have passed to the recordset in the lpszSQL parameter to the Open member function. This is because the recordset constructs a full SQL statement based on what you passed to Open, what you specified with ClassWizard, and what you may have specified in the m_strFilter and m_strSort data members.

Important   Call this member function only after calling Open.

For more information about creating recordsets, see the article in Visual C++ Programmer's Guide. For related information, see the topic "SQL Property" in DAO Help.

CDaoRecordset OverviewClass MembersHierarchy Chart

See Also   CDaoRecordset::GetDefaultSQL, CDaoRecordset::GetDefaultDBName, CDaoRecordset::GetName, CDaoRecordset::GetType