CDaoTableDef::GetConnect
CString GetConnect( );
throw( CDaoException, CMemoryException );
Return Value
A CString object containing the path and database type for the table.
Remarks
Call this member function to obtain the connect string for a data source. For a CDaoTableDef object that represents an attached table, the CString object consists of one or two parts (a database type specifier and a path to the database).
The path as shown in the table below is the full path for the directory containing the database files and must be preceded by the identifier "DATABASE=". In some cases (as with Microsoft Jet and Microsoft Excel databases), a specific filename is included in the database path argument.
The table in CDaoTableDef::SetConnect shows possible database types and their corresponding database specifiers and paths:
For Microsoft Jet database base tables, the specifier is a empty string ("").
If a password is required but not provided, the ODBC driver displays a login dialog box the first time a table is accessed and again if the connection is closed and reopened. If an attached table has the dbAttachSavePWD attribute, the login prompt will not appear when the table is reopened.
For more information on tabledefs, see the articles and in Visual C++ Programmer's Guide. For related information, see the topic "Connect Property" in DAO Help.
CDaoTableDef Overview | Class Members | Hierarchy Chart
See Also CDaoTableDef::SetConnect