none
Equivalent to MS-Access CreateWorkspace under VS2008 RRS feed

  • Question

  • I am building a VS2008/VB.NET application which will interface to a VB6 legacy application where the data source of the VB6 application is MS-Access using work spaces. From my research I see no clear method to create a DAO workspace using VB.NET and I can not change the database since the VB6 application can not be changed.

     


    KSG

    Any thoughts on how I can gain access to this database via code to access the security where I have the proper user name and password would be of great help.

    Relevant VB6 code snippet (taken from legacy project)

    Global gdbMainDatabase As Database
    
    Global gwsMainworkSpace As Workspace
    
    …
    
    Set gwsMainworkSpace = CreateWorkspace("CorpAces", "Aces Admin", CryptPassword(BIG_SECRET))
    
    …
    
    Set gdbMainDatabase = gwsMainworkSpace.OpenDatabase(gsMAINDATABASE)
    
    
    
    

     

    Wednesday, September 30, 2009 3:01 PM

Answers

  • Workspaces is a feature specific to Access DAO. There is no such concept as Workspaces in ADO or ADO.NET. In .NET the closest class would be System.Data.OleDb.OleDbConnection.

    If absolutely required you can still use DAO from .NET via COM interop.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Yichun_Feng Tuesday, October 6, 2009 6:02 AM
    Wednesday, September 30, 2009 3:13 PM
  • The syntax will probably change a bit since .NET generally complains without explicit data typing and direct references to class properties. It will also be a bit different if you're using the Office Primary Interop Assembly for DAO instead of the generic version.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Yichun_Feng Tuesday, October 6, 2009 6:02 AM
    Wednesday, September 30, 2009 4:41 PM

All replies

  • Workspaces is a feature specific to Access DAO. There is no such concept as Workspaces in ADO or ADO.NET. In .NET the closest class would be System.Data.OleDb.OleDbConnection.

    If absolutely required you can still use DAO from .NET via COM interop.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Yichun_Feng Tuesday, October 6, 2009 6:02 AM
    Wednesday, September 30, 2009 3:13 PM
  • Workspaces is a feature specific to Access DAO. There is no such concept as Workspaces in ADO or ADO.NET. In .NET the closest class would be System.Data.OleDb.OleDbConnection.

    If absolutely required you can still use DAO from .NET via COM interop.
    Paul ~~~~ Microsoft MVP (Visual Basic)

    Thanks Paul. I did look at DAO via adding a reference to my .NET project but hung up getting CreateWorkspace to compile (I would provide this code but have deleted it). Any ways thanks for the quick reply.
    KSG
    Wednesday, September 30, 2009 3:38 PM
  • The syntax will probably change a bit since .NET generally complains without explicit data typing and direct references to class properties. It will also be a bit different if you're using the Office Primary Interop Assembly for DAO instead of the generic version.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Yichun_Feng Tuesday, October 6, 2009 6:02 AM
    Wednesday, September 30, 2009 4:41 PM