We help IT Professionals succeed at work.

vba to create a .accde file with 64-bit Access 2013

Thomas
Thomas asked
on
488 Views
Last Modified: 2016-02-11
I successfully use the following code for 32-bit Access:

Public Function ConvertToAccde(SourceDB As String, TargetDB As String) As Boolean
    Dim accessApplication As Access.Application
   
    ConvertToAccde = False
    Set accessApplication = New Access.Application
    With accessApplication
        .SysCmd 603, SourceDB, TargetDB
    End With
    ConvertToAccde = True
    Set accessApplication = Nothing
Exit Function

However, this code does not work for 64-bit Access 2013. It hangs on the .SysCmd line and never exits.

Suggestions please.
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Top Expert 2016

Commented:
Jim Dettman (EE MVE)President / Owner
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2017

Commented:
That's an un-documented SysCmd() Call, so it's anyone's guess if it even still exists in the same place as it was before, or in the same format.

Jim.
Jim Dettman (EE MVE)President / Owner
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2017
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Adding both suggested lines works:

    With accessApplication
        .UserControl = True
        .AutomationSecurity = 1
        .SysCmd 603, SourceDB, TargetDB
    End With

However, opening the accde file shows a white background on some buttons. I will upload a pic if I have that option.

Thank you capricorn1 and Jim Dettman.

Author

Commented:
Pic of buttons with a white background, resulting from opening the accde.
pic.jpg

Author

Commented:
Of course, the database has many buttons, but only some buttons have the white background. This does not occur if the accde is created by Access Save As Make ACCDE.
Jim Dettman (EE MVE)President / Owner
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2017

Commented:
Interesting.

Personally I would not use that call.  There's too many things needed to make a xDE successfully that cannot be automated.

I know a number of people have tried, but all have given up in the end.  It's just one of those things that probably should remain a manual operation.

Even that aside, the thing with the 603 call is that it may only be one of many steps of the process internally in Access that gets performed when you use "Save as".   603 may be doing nothing more than stripping the source code out and not updating resources, checking that the app is compiled, etc.

In fact your result proves that given that you get a different result.

Jim.

Author

Commented:
Thank you Jim. That sounds good to me.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.