Problems with CreateWorkspace() method

Problems with CreateWorkspace() method

Post by Vic » Wed, 03 Feb 1999 04:00:00


I am trying to access a Microsoft Jet Database file (.mdb) through an MFC Application.
When I call the CreateWorkspace() method, there are no exceptions generated but I get the following error:
Operation is not supported for this type of object. (Error 3251)

My code:

CdbDBEngine dbEngine;
CdbWorkspace dbWspace;
int nErrCnt;

  dbWspace = dbEngine.CreateWorkspace( "MyWorkSpace", "Admin", "", dbUseJet );


catch( CdbException* e )
  AfxMessageBox( e->m_strError );


if( nErrCnt = dbEngine.Errors.GetCount() > 0 )
  long lIndex = nErrCnt-1;
  CdbError dbError = dbEngine.Errors[lIndex];
  AfxMessageBox( dbError.GetDescription() );


Has anyone experienced a similar problem?


-----------------** -- Posted from CodeGuru -- **-----------------    The website for Visual C++ programmers.


1. Help me understand CreateWorkspace method

Using VB to write to an Access file with user level security, I dont want
the logon box to popup, nor do i need a session of Access to open. How do i
clean this up?

In the following, the logon box will popup and access will open visibly, but
neither of them are used by the VB program.

''user level security, user tap has been logging into access manually

''this line pops up the access logon box with the user tap shown, not bob
Set DBWorkspace = DBEngine.CreateWorkspace("NEW", "bob", "bob")

''the logon box has to be satisfied, if tap logs on then
''now a copy of access is running with user tap

''programDB does not load into the visible session of access
Set DBASAP = DBASAPWorkspace.OpenDatabase("programDB")

''message box shows bob
Dim doctemp As Document
Set doctemp = DBASAP.Containers("tables").Documents(0)
MsgBox doctemp.UserName

'program runs and if bob has appropriate rights, the program inserts data

2. Anybody using Veritas clustering & MTS?

3. CreateWorkspace - security problem in VB4

4. Importing (Merging) Access Tables?

5. Jet CreateWorkspace problems in VB 4

6. what was ms thinking

7. CreateWorkspace problem

8. installing oracle 8.17

9. Createworkspace problem in VB4-16bit - (Help)

10. Createworkspace problem in VB4 (Help)

11. Help....Error 3028: CreateWorkspace error.

12. BUG in CREATEWORKSPACE or what???