문제

What i am trying is to access the MS Access properties without actually opening the database.

Here is some code to get a better understanding:

var processStartInfo = new ProcessStartInfo(args[0]) 
    { 
        WindowStyle = ProcessWindowStyle.Hidden, 
        CreateNoWindow = true
    };

Process.Start(processStartInfo);

application = (Access.Application)Marshal.GetActiveObject("Access.Application");

dao.Property allowByPassKeyProperty = null;

foreach (dao.Property property in application.CurrentDb().Properties)
{
    if (property.Name == "AllowByPassKey")
    {
        allowByPassKeyProperty = property;
        break;
    }
}

My problem is that in that case, I open the database in order to look for the properties (application.CurrentDb().Properties) and the MS Access startup stuff kicks in.

I want to avoid all the startup stuff, and just inject the right value for the property.

Is it possible to go through the properties, maybe with reflection and late binding like that: http://www.codeproject.com/KB/database/mdbcompact_latebind.aspx?

Or is there any other option to achieve what I'd like?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top