CRecordset::GetDefaultSQL

virtual CString GetDefaultSQL( );

Return Value

A CString that contains the default SQL statement.

Remarks

The framework calls this member function to get the default SQL statement on which the recordset is based. This might be a table name or an SQL SELECT statement.

You indirectly define the default SQL statement by declaring your recordset class with ClassWizard, and ClassWizard performs this task for you.

If you need the SQL statement string for your own use, call GetSQL, which returns the SQL statement used to select the recordset’s records when it was opened. You can edit the default SQL string in your class’s override of GetDefaultSQL. For example, you could specify a call to a predefined query using a CALL statement. For more information, see the article Recordset: Declaring a Class for a Table (ODBC) in Visual C++ Programmer’s Guide.

Caution   The table name will be empty if the framework could not identify a table name, if multiple table names were supplied, or if a CALL statement could not be interpreted. Note that when using a CALL statement, you must not insert whitespace between the curly brace and the CALL keyword, nor should you insert whitespace before the curly brace or before the SELECT keyword in a SELECT statement.

CRecordset OverviewClass MembersHierarchy Chart

See Also   CRecordset::GetSQL