Help me understand CreateWorkspace method

Help me understand CreateWorkspace method

Post by Terry Pries » Thu, 01 Mar 2001 23:55:07

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


1. Problems with CreateWorkspace() method


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.

2. Help: Poor IMP Performance, Win 2000

3. Still not understanding the DAO method of exporting data from access to an excel worksheet

4. US-NJ: Lawrenceville-Senior Oracle 9i AS Developer

5. Createworkspace problem in VB4 (Help)

6. Index element from a set of a row type under US V9.11

7. HELP! - Error 3633 during VBA CreateWorkspace

8. Help....Error 3028: CreateWorkspace error.

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

10. CreateWorkspace Question

11. CreateWorkspace - security problem in VB4

12. VB4 Prof.: CreateWorkspace