void SetConnect( LPCTSTR lpszConnect );
throw( CDaoException, CMemoryException );
Parameters
lpszConnect
A string that contains a connect string for the associated CDaoDatabase object.
Remarks
Call this member function to set the querydef object’s connect string. The connect string is used to pass additional information to ODBC and certain ISAM drivers as needed. It is not used for Microsoft Jet (.MDB) databases.
Tip The preferred way to work with ODBC tables is to attach them to an .MDB database. For more information, see the topic "Accessing External Databases with DAO" in DAO Help and the article DAO External: Working with External Data Sources in Visual C++ Programmer's Guide.
Before executing a querydef that represents an SQL pass-through query to an ODBC data source, set the connect string with SetConnect and call SetReturnsRecords to specify whether the query returns records.
For more information about the connect string’s structure and examples of connect string components, see the topic "Connect Property" in DAO Help. For information about querydefs, see the article DAO Querydef in Visual C++ Programmer's Guide.