Access 2010. Generate .accde using VBA code (1 Viewer)

nilopa

New member
Local time
Today, 22:37
Joined
Sep 18, 2015
Messages
3
From an Access 2010 application, I am trying to generate a ".accde" file using VBA code from a ".accdb" file. I´m using the "app.SysCmd 603, INPATH, OUTPATH" method, but always returns 0 and do not works.

Any idea how to fix it?
 

Trevor G

Registered User.
Local time
Today, 21:37
Joined
Oct 1, 2009
Messages
2,341
Have a go with this code which I wrote in another thread:

Function ConvertToaccDE()
sourcedb = "C:\Users\Trevor G\Documents\sample back.accdb"
targetdb = "C:\Users\Trevor G\Documents\sample back.accde"
Dim accessApplication As Access.Application
Set accessApplication = New Access.Application
With accessApplication
.SysCmd 603, sourcedb, targetdb
End With
'Set accessApplication = Nothing

End Function
 

nilopa

New member
Local time
Today, 22:37
Joined
Sep 18, 2015
Messages
3
It's SOLVED.
The problem was a compilation error in another part of the application.
This keep off generate .accde file.
I'm using the same code that you recommend me, and it works correctly if there is no compilation error
Thank you.
 

Leo_Polla_Psemata

Registered User.
Local time
Today, 14:37
Joined
Mar 24, 2014
Messages
364
Have a go with this code which I wrote in another thread:

Dear Trevor, I copy paste this bit of code into my accdb, I fixed the source and target to meet my pc directories, then what ? What should I do to execute it ?
 

databasedonr

Registered User.
Local time
Today, 17:37
Joined
Feb 13, 2003
Messages
163
Just a follow up to this process, as I've been trying to do the same thing, but it appears that you cannot be in the database from which you wish to create the mde (the source database). I've successfully used code similar to the above, but have not been successful if running it from the source database.

My dilemma is that I have an application installed for a user that is remote - and rather than trying to talk them through creating the mde (accde) I wanted to do it for them in the new version of the front end.... but it doesn't work as described above.

If someone has a solution to this, I'd be very keen.

Thanks,
Don
 

JHB

Have been here a while
Local time
Today, 22:37
Joined
Jun 17, 2012
Messages
7,732
..
If someone has a solution to this, I'd be very keen.
I don't think you'll be able to do it from within the database because code is still executing in it, (the code which should create the accde database).
The only idea I've is to create another small database with the only function to create the accde database from the accdb database.
 

databasedonr

Registered User.
Local time
Today, 17:37
Joined
Feb 13, 2003
Messages
163
Thanks JHB, that's what I was thinking. I'm trying to come up with an elegant way to distribute new front-ends that are hands-off for my users.
 

Users who are viewing this thread

Top Bottom