0

I'm trying to convert a password protected ms access database to ACCDE I tried a lot of things like the following :

Microsoft.Office.Interop.Access.Application AccApp = new Microsoft.Office.Interop.Access.Application();
string MyFile = Environment.CurrentDirectory + "\\Baseet.accdb";
string MyCompiledFile = Environment.CurrentDirectory + "\\Baseet.accde";

AccApp.Visible = true;
AccApp.OpenCurrentDatabase(MyFile, false, "017014A");
AccApp.RunCommand(AcCommand.acCmdAppMaximize);

AccApp.SysCmd (603 , MyFile , MyCompiledFile);

But I got this compiler error on 603 :

Cannot convert from int to Microsoft.Office.Interop.Access.AcSysCmdAction

I looked at the documentation for Microsoft.Office.Interop.Access.AcSysCmdAction here But I couldn't find that command although it exists in VBA , It turned out to be undocumented command.

How can I fix it , Any help appreciated .

Csharp Newbie
  • 303
  • 1
  • 10
  • I don't think you can use undocumented functions/enums through the primary interop assemblies. I recommend using unbound COM instead. – Erik A Jun 15 '22 at 12:02
  • @ErikA Thanks for replying , I don't know about that could you make a demo code ? Thanks – Csharp Newbie Jun 15 '22 at 12:26
  • Sorry, I mean late-bound COM. See https://stackoverflow.com/q/403218/7296893, example is Excel but principles should translate. Look for the answer with dynamic, as that's much easier than the older accepted answer. – Erik A Jun 15 '22 at 13:43

0 Answers0