CDatabaseConnection::ConnectToDatabase

[This is preliminary documentation and subject to change.]

The ConnectToDatabase method creates a workspace and opens a connection to the specified database.

BOOL ConnectToDatabase(
  const CString &csViewer,  
  const CString &csPassword,  
  const CString &systemFile,  
  const CString &databaseFile,  
  CString csWorkspaceName   
);
 

Parameters

csViewer
A reference to an MFC CString object that contains the viewer name. Loader applications should log on as "Loader". This ensures that they have read/write permissions to the database.
csPassword
A reference to an MFC CString object that contains the password of the user specified in csViewer. This string is not changed by the method call.
systemFile
A reference to an MFC CString object that contains the full path and file name of the workgroup information file. You can obtain this value by calling the ITelevisionServices::get_SystemFile method.
databaseFile
A reference to an MFC CString object that specifies the path and name of the database file. This string is not changed by the method call.
csWorkspaceName
A reference to an MFC CString object containing the name of the open workspace. You can call the GetWorkspaceName method to get this information after ConnectToDatabase returns. The loaders can use any workspace name, but "LoaderWSP" is recommended.

Return Values

If the database was successfully opened this method returns TRUE. Otherwise it returns FALSE.

Remarks

The ConnectToDatabase method calls StartEngine automatically if the Jet database engine hasn't already been started. However, if you need to use engine functionality, such as compacting or repairs, without opening the database, you can call StartEngine explicitly.

QuickInfo

  Windows NT: Unsupported.
  Windows: Requires Windows 98.
  Windows CE: Unsupported.
  Header: Declared in dbsets.h.
  Import Library: Use dbsets.lib or dbsetsSt.lib.
  Unicode: Yes.