Access 2010. Generate .accde using VBA code

nilopa

New member
Local time
Today, 07:47
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?
 
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
 
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.
 
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 ?
 
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
 
..
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.
 
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

Back
Top Bottom