Programmatically create a ACCDE

srbond@hotmail.com

New member
Local time
Today, 13:51
Joined
Nov 17, 2010
Messages
1
Hi,

I am using Access 2007 and need to programmatically create a ACCDE file through VBA.

Here is the flow:

1. My accdb changes some internal settings for production
2. My accdb file then copies itself to a TMP accdb file
3. My orignal accdb file then attemps to compile the TMP accdb file to an accde file (this now fails).
4. My orignal accdb file then deletes the TMP accdb file and copies the new accde file to the production server
5. My orignal accdb then changes the internal settings back for development.


Here is the code that fails:
--------------------------------------------
Dim appAccess As New Access.Application
With appAccess
appAccess.AutomationSecurity = 3 'MsoAutomationSecurityLow
appAccess.SysCmd 603, sLocalPath & sStageName, sLocalPath _
& gsNetName_Stage
End With
---------------------------------------------

This worked fine in Access 2003, but the 603 code does not work in 2007 - no error, no nothing except that no accde file is created.

Any help is appreciated on how to programmatically make an accde file.


Thanks,

Scott
 
AFAIK, to set the security to low you want 1 not 3.

Try This:

Code:
Dim appAccess As New Access.Application
With appAccess

 .AutomationSecurity = 1 'MsoAutomationSecurityLow

 .usercontrol=true

  .SysCmd 603, sLocalPath & sStageName, sLocalPath _
& gsNetName_Stage
End With
** air code** Unfortunately I am not at a machine with 2007 or 2010 so I can not test this.
 

Users who are viewing this thread

Back
Top Bottom