PRB: DAO Error 3028 When Creating a DAO Workspace

Last reviewed: June 26, 1997
Article ID: Q146876
The information in this article applies to:
  • The Microsoft Foundation Classes (MFC) included with: - Microsoft Visual C++, 32-bit Edition, versions 4.0, 5.0
  • The DAO SDK included with: - Microsoft Visual C++, 32-bit Edition, versions 4.0, 4.1, 4.2, 5.0

SYMPTOMS

The following DAO error 3028 may occur when you try to create a workspace DAO object:

   Can't start application. The system database is missing or opened
   exclusively by another user.

CAUSE

This error can occur if you have failed to specify a system database or have assigned the system database after performing operations with the database engine.

RESOLUTION

It is important that the SystemDB property of the database engine be set prior to performing any operations with the database engine. If you are using the dbDAO C++ classes included with the DAO SDK, you can set the system database by using code similar to this code:

   // get database engine object but don't fill its collections
   CdbDBEngine eng(FALSE, FALSE);

   // set the system database
   eng.SetSystemDB(_T("d:\\work\\sectest.mdw"));

   // Finish initializing the engine object
   eng.Start();

   CdbWorkspace wsp;

   // The following function call will generate the 3028
   // error if a System Database hasn't been assigned or if the
   // second argument of the constructor for CdbDBEngine didn't
   // receive FALSE.

   wsp= eng.CreateWorkspace(_T("Test"),_T("MyUserName"),
                            _T("MyPassword"));

Or, alternately, use the CdbDBEngine::SetInitPath() method before opening or creating a CdbWorkspace object.

If you are using the MFC DAO classes, use code similar to this code:

   //Initialize global MFC DAO engine
   AfxDaoInit( );
   DAODBEngine* pDBEngine = AfxDaoGetEngine( );

   // Set up system database
   COleVariant var( _T("d:\\work\\sectest.mdw"), VT_BSTRT );
   // NOTE: put_SystemDB was a late addition to DAO
   // and is not yet wrapped by MFC
   DAO_CHECK( pDBEngine->put_SystemDB( var.bstrVal ) );

   CDaoWorkspace wsp;
   wsp.Create(_T("Test"),_T("MyUserName"), _T("MyPassword"));

Or, alternately, use the CDaoWorkspace::SetInitPath() method before opening or creating a CDaoWorkspace object.

STATUS

This behavior is by design.


Keywords : dbDao kbcode kbprg MfcDAO
Technology : kbMfc
Version : 4.0 4.1 4.2 5.0
Platform : NT WINDOWS
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 26, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.