CDaoQueryDef::SetSQL

Call this member function to set the SQL statement that the querydef executes.

void SetSQL( 
   LPCTSTR lpszSQL  
);

Parameters

  • lpszSQL
    A string containing a complete SQL statement, suitable for execution. The syntax of this string depends on the DBMS that your query targets. For a discussion of syntax used in the Microsoft Jet database engine, see the topic "Building SQL Statements in Code" in DAO Help.

Remarks

A typical use of SetSQL is setting up a querydef object for use in a SQL pass-through query. (For the syntax of SQL pass-through queries on your target DBMS, see the documentation for your DBMS.)

Requirements

Header: afxdao.h

See Also

Reference

CDaoQueryDef Class

Hierarchy Chart

CDaoQueryDef::GetSQL

CDaoQueryDef::SetName

CDaoQueryDef::SetConnect

CDaoQueryDef::SetODBCTimeout

CDaoQueryDef::SetReturnsRecords

Other Resources

CDaoQueryDef Members