C#, Access, and DAO

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?a2VubmV0aGo=?=

    #1

    C#, Access, and DAO

    I've been searching everywhere to no avail. What I'm trying to do is connect
    to an Access database and read Access properties, like the startup properties
    or custom properties. In my case this is version. I have been able to connect
    to the database fine using com interop and dao. My issue is that all the
    properties show up as "system._comobj ect". I am hoping someone else has been
    as geeky as me and already found a solution to this. I am open to any method
    of connecting to the database but not any methods of changing how versioning
    works. The versioning system in place works great and has for several years
    I'm just trying to rewrite the system used to open my companies main Access
    portal from classic VB6 to C#. The code I have to open the connection works
    fine.

    dao._DBEngine dbEng = new dao.DBEngineCla ss();
    dbEng.SystemDB = Globals.WRKGRP;
    dao.Workspace ws = dbEng.CreateWor kspace("WS1",
    GlobalResources .aoDEFAULT_ACCE SS_ADMIN, "", dao.WorkspaceTy peEnum.dbUseJet );
    dao.Database dbMaster = ws.OpenDatabase (databasePath, false, false, "");
    dao.Database dbLocal = ws.OpenDatabase (localPath, false, false, "");

    I'm reading the properties like so:

    foreach (dao.Property dbPropMaster in dbMaster.Proper ties)
    {
    versionMaster = dbPropMaster.Va lue.ToString();
    }

    I'm using VS 2005 and connecting to Access MDBs currently used in a
    2002/2003 format. Any pointers or help would be much appreciated.

Working...