var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
I would like to compile the access db runtime. Does anybody know how to compile dynamically the access DB?
I have MS Access 2002 and VBA 184.108.40.206. I have tried :
VBIDE.VBProject vbp = oAccess.VBE.ActiveVBProject;
I've tested the Item(1), all was OK, BuildFileName etc. but I get error in execution, Access said something like "Cannot complete command".
The sae result I had when tried:
oAccess.DoCmd.SelectObject(Access.AcObjectType.acM odule, "Module", false);
Thank you in advance.
I assume the code does actually compile manually without errors? If so, both of these methods should work;
SysCmd 504, 16483
The second is an undocumented way of doing it (which means M$ don't support this method).
Note: If the code contains errors, these methods will not warn you - they will simply fail to compile.
The error is "Cannot compile project" and I have such error when I've made a macro with RunCommand "CompileAllModules" and tried to run it in Access. But when I open VB and choose Debug:Compile all is OK
Any ideas? maybe something wrong in VB?
I have Access object as process by:
oAccess = (Access.Application) Marshal.BindToMoniker(sDBPath);
oAccess.OpenCurrentDatabase(sDBPath, true, "");
All bugs disappeared when I've got Access db by second method. But I'm still curious about the errors when using the first.
Also interesting: DoCmd.RunCommand(acCmdCompileAllModules) does not display any errors, even if it fails to compile the code. However, in the macro form it does. Strange.
Ok, so BindToMoniker is the .Net equivelent of GetObject() in VB6/VBA, so I tried to replicate your problem by creating a macro then testing this:
Which worked fine. Not sure why it wouldn't work in .Net
Set objAccess = GetObject(strDbPath)
I've missed to tell that the db was 97, I have converted it to 2002 manually and then I've made my experiments.
By the second way (oAccess.OpenCurrentDatabase(sDBPath, true, "") I'm using 97 db without any problems.