Single project composed of different sections - how supply different versions?

Yes, I understand, and so I'll explain the request again
I didn't ask to create a system that 'dynamically' configures itself to have the features of Version1 or Version2 or any other version

The request is: having a project created with Access that I'll call Version0 (I'm talking about the front-end part only, not the data) and containing 100 forms, 100 reports, 100 modules, how can I build a system that can compose the Version1 application composed of 50 forms, 30 reports, 10 Version0 modules, similarly how to prepare the Version2 application composed of 10 forms, 3 reports, 2 Version0 modules

So the complete project will remain Version0, and this project can be updated regularly, both with corrections to any anomalies and with the addition of new features
Every time the Version0 project is modified, I have to recreate Version1 and Version2 (...VersionN) with the limited set of forms, reports, modules, which will be assigned to them
This is the work I would like to speed up, the regeneration of the various subprojects every time changes are made to the main project
Both the main project Version0 and the subprojects Version1 and Version2 connect to the same database, in my case via odbc to a db server external to the Access procedures

The final effect is similar to that obtained by always keeping the same identical project and limiting the functionality via software with an activation key or similar systems
In this case the main project is cut and various subprojects are packaged
 
Every time the Version0 project is modified, I have to recreate Version1 and Version2 (...VersionN) with the limited set of forms, reports, modules, which will be assigned to them
You could create an application in which you configure the different versions and then create the different versions similar to the msaccess-vcs.
In principle, you could even use the msaccess vcs to create it. You just have to make sure that the appropriate files are available in the folder of the specific version.
 
It could be as simple as this:
Code:
Sub CopyVersions()
    ' Version1: delete query1 and form1
    CreateObject("Scripting.FileSystemObject").CopyFile CurrentProject.FullName, CurrentProject.Path & "\Version1.accdb", True
    With CreateObject("Access.Application")
        .OpenCurrentDatabase CurrentProject.Path & "\Version1.accdb"
        .DoCmd.DeleteObject acQuery, "query1"
        .DoCmd.DeleteObject acForm, "form1"
        .CloseCurrentDatabase
        .Quit
    End With
    
    ' Version2: delete report1 and form1
    CreateObject("Scripting.FileSystemObject").CopyFile CurrentProject.FullName, CurrentProject.Path & "\Version2.accdb", True
    With CreateObject("Access.Application")
        .OpenCurrentDatabase CurrentProject.Path & "\Version2.accdb"
        .DoCmd.DeleteObject acReport, "report1"
        .DoCmd.DeleteObject acForm, "form1"
        .CloseCurrentDatabase
        .Quit
    End With
End Sub

Check the attached file, go to mod2 module and run the CopyVersions sub.
 

Attachments

You could create an application in which you configure the different versions and then create the different versions similar to the msaccess-vcs.
In principle, you could even use the msaccess vcs to create it. You just have to make sure that the appropriate files are available in the folder of the specific version.

Yes great ideaAnd so the sequence could be:
1- changes to Version0
2- creation of text files with MasAccess-Vcs
3- the program for the regeneration of Version1 takes all the text files, copies them into its own directory, deletes unnecessary files, launches the creation of Access files from text files
Even if, thinking about it again, there is not a big difference between going from intermediate text files or directly deleting forms, reports, modules from the main file Version0, in essence it is the same thing
 
It could be as simple as this:
Code:
Sub CopyVersions()
    ' Version1: delete query1 and form1
    CreateObject("Scripting.FileSystemObject").CopyFile CurrentProject.FullName, CurrentProject.Path & "\Version1.accdb", True
    With CreateObject("Access.Application")
        .OpenCurrentDatabase CurrentProject.Path & "\Version1.accdb"
        .DoCmd.DeleteObject acQuery, "query1"
        .DoCmd.DeleteObject acForm, "form1"
        .CloseCurrentDatabase
        .Quit
    End With
   
    ' Version2: delete report1 and form1
    CreateObject("Scripting.FileSystemObject").CopyFile CurrentProject.FullName, CurrentProject.Path & "\Version2.accdb", True
    With CreateObject("Access.Application")
        .OpenCurrentDatabase CurrentProject.Path & "\Version2.accdb"
        .DoCmd.DeleteObject acReport, "report1"
        .DoCmd.DeleteObject acForm, "form1"
        .CloseCurrentDatabase
        .Quit
    End With
End Sub

Check the attached file, go to mod2 module and run the CopyVersions sub.

Yes, this is also a great idea
I hadn't thought of making Version1 or Version2 by taking Version0 and deleting things
 
Even if, thinking about it again, there is not a big difference between going from intermediate text files or directly deleting forms, reports, modules from the main file Version0, in essence it is the same thing
Deleting the objects in the database file directly is less time-consuming if it is only a matter of creating the versions.
The variant with the exported files would have the advantage that you can use version control system with different branches fro each app version, then you could update the branches with rebase or merge, for example, and the deletion with each update could possibly be omitted completely.

Quick side thought:
I created an add-in that allows me to import reusable codemodules including their dependencies.
To do this, I write the codemodules that it requires as a comment (similar to xml tags) in each codemodule.
You could also use a similar concept to automatically compile each required version.

Example:
Code:
'<codelib>
'  <file>data/FilterStringBuilder.cls</file>
'  <license>_codelib/license.bas</license>
'  <use>text/StringCollection.cls</use>
'  <use>data/SqlTools.cls</use>
'  <test>_test/data/FilterStringBuilderTests.cls</test>
'</codelib>
 

Users who are viewing this thread

Back
Top Bottom