Avatar of Thomas
Thomas
Flag for United States of America asked on

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

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.
Microsoft AccessVBA

Avatar of undefined
Last Comment
Thomas

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rey Obrero (Capricorn1)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Rey Obrero (Capricorn1)

Jim Dettman (EE MVE)

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.
SOLUTION
Jim Dettman (EE MVE)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Thomas

ASKER
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.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Thomas

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

ASKER
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)

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.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Thomas

ASKER
Thank you Jim. That sounds good to me.