UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
2 Pages V < 1 2  (Go to first unread post)
   Reply to this topicStart new topic
> Create Accde From Within The Accdb - Vba, Access 2016    
 
   
Louverril
post Jan 7 2020, 11:53 AM
Post#21



Posts: 516
Joined: 29-April 08



Thanks GroverParkGeorge - that's what I thought!

That's why I have persevered so far with the other method.

Looks like I will have to just accept I have to copy it first- its just it creates more things to go wrong :-(.

--------------------
Cheers!

Allyson
UK North Yorkshire / North East
Go to the top of the page
 
isladogs
post Jan 7 2020, 12:41 PM
Post#22


UtterAccess VIP
Posts: 2,088
Joined: 4-June 18
From: Somerset, UK


Allyson
I haven't tried this and, like several others, had no idea such code existed.
However, whilst I very much like finding out about obscure items of code, I'm not sure I understand why you would want to do this at all using VBA.
Would you mind explaining why being able to create an ACCDE using code would be beneficial compared to using the interface.

--------------------
Colin (Mendip Data Systems)
Website, email
Go to the top of the page
 
JeffK
post Jan 7 2020, 02:31 PM
Post#23


UtterAccess VIP
Posts: 1,585
Joined: 19-December 02
From: Lansing, MI


I use the automation of mde/accde creation in an admin hub application that handles all aspects of promoting database files from development to production. It's used by developers to enforce versioning, backups of prior versions and the mde/accde creation for those databases that are flagged to be released this way. It also enforces other "promotion checks", such as:

Appropriate startup properties
Tables flagged as temporary are empty
No banned VBA references
Appropriate class module instancing properties
Go to the top of the page
 
isladogs
post Jan 7 2020, 03:57 PM
Post#24


UtterAccess VIP
Posts: 2,088
Joined: 4-June 18
From: Somerset, UK


Thanks Jeff
I do similar checks but then create the ACCDE file using the interface. That way I feel I'm in control.

Allyson's apparent willingness to first copy the file so she can create an ACCDE using code just seems to be adding unnecessary complexity to the process...IMO.

--------------------
Colin (Mendip Data Systems)
Website, email
Go to the top of the page
 
nuclear_nick
post Jan 8 2020, 07:08 AM
Post#25



Posts: 1,825
Joined: 5-February 06
From: Ohio, USA


I can't remember where I read it, but you cannot compile the current database you're working in into an accde using code, because the operation cannot be done on a database that has a lock file associated with it. You can, however, use a 'middle man' database, as JeffK suggested.

I use a three-folder approach... a 'development' folder, a 'promoting' folder, and a 'release' folder. My 'hub' application (in reference to JeffK's post) handles copying the file from 'development' to 'promoting', creating the accde (using the copy in the 'promoting' folder), and copying the finished accde (if created successfully) from the 'promoting' folder to the 'release' folder. (There's a little more to it than that, what was just described is the basics.)

(Before submitting, I did another search. All mentions I found of the '603' command mention that it cannot be used on the currently open database. No reasons found, just that it cannot be done.)

--------------------
"Nuclear" Nick
____________
The top three reasons to hide code; 1) It's not your own. 2) It's your own, but it's so crappy you don't want anyone to see it. 3) The comments in your code would get you in a lot of trouble if ever made public.
Go to the top of the page
 
GroverParkGeorge
post Jan 8 2020, 08:53 AM
Post#26


UA Admin
Posts: 36,489
Joined: 20-June 02
From: Newcastle, WA


Two things. First, it's always a pleasure to learn something new (the 603 argument) after more than 20 years of working with our lovable little pal, Access.

Second, some years ago I was in a position where I had to manage around a dozen mdb/accdbs for a reporting operation. Regular Compact & Repair and backups were crucial.

I built a master accdb to do that along the lines Jeff describes. Because I had control over where the various files were permanently stored for production and where backups were stored, I was able to hard-code that information in a table and automate the entire process by opening a recordset on that table and looping through the process for each one. It could take quite a while to run through them all, a half-hour or so IIRC. It included an audit table to record when each step was completed.

I would have been very easy to add a step to create accde/mde versions as part of the process.

To do that for a single accdb in preparation for a deployment of a new version of an Access Relational Database Application may be a bit over-the-top, I suppose. On the other hand, it might be good in that it IS automated and would be entirely replicable and documented by the process.

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
JeffK
post Jan 8 2020, 10:28 AM
Post#27


UtterAccess VIP
Posts: 1,585
Joined: 19-December 02
From: Lansing, MI


Thanks, George, that sounds similar to my situation. My team is responsible for ~1,750 access files spanning over 100 applications. The promotion of these applications involves many steps and can occur several times throughout a work day. Many applications are interdependent, with VBA references to each other in multiple layers. A simple example is a reporting application referencing the code library, but also the ETL application, which also references the code library. Nestings go several levels deep in more complicated applications. Creation of accde files is one step in the middle of many other automated ones.

Years ago we tried to automate creation of the accde inside the database itself. The copying of the current file could be scripted along with the accde creation, but wouldn't work if the file was locked. Ultimately it didn't matter though. Promotion takes place in the hub system, which is always affecting files other than itself.
Go to the top of the page
 
GroverParkGeorge
post Jan 8 2020, 11:00 AM
Post#28


UA Admin
Posts: 36,489
Joined: 20-June 02
From: Newcastle, WA


Sounds like you took the concept to a whole other level. With good results. thumbup.gif

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
2 Pages V < 1 2


Custom Search


RSSSearch   Top   Lo-Fi    19th January 2020 - 09:23 AM