Giter VIP home page Giter VIP logo

ms-access-vba-libraries's Introduction

MS Access Libraries

This is a collection of standalone VBA libraries for MS Access projects. This is a WIP, I do not suggesting using in any sort of production project at this time.

The basic idea is to pull libraries references into your main project programmatically and automatically. To do this, we can save all libraries as .accda files, and place them all in a folder called libraries, then when the database is opened, we loop through these libraries and add them as references to your project.

This keeps your main application clean, with only the business logic unique to your project while still benefiting from useful, reusable, libraries of code. This is, in my opinion, a much better option than copying and pasting random code into your project.

Update (Mar 04 19)

First time installing the project at work. Attempted to use the flow as intented, realized a huge flaw in the plan. Your all probably familiar with the "Enable Content" popup for enabling VBA/Macros that end users must select in order for your code to run. The problem with the "seperate" libraries is, Access requires that users enable code for all libraries. I knew this, but when developing locally and actively editing the source files it totally slipped my mind.

This may, or may not, be a big issue for your use case. For me, the applications I would be builing have upwards of 30 users, many of which I will never meet. So it is not really a viable option to have end users enable all these libaries.

My thought at the moment is to create the ability for developers to "build" the production database, this process would involve importing all used code into the primary database when getting ready to release the database. But until I flesh this idea out more, I will be putting this project on a temporary hold.

Installation

  1. Download the library(ies) that you want to use
  2. Create a libraries folder in your project root
  3. Add the addReferences function below to your main project
  4. Ensure that this addReferences function is called when you open the database
Public Function addReferences()

On Error Resume Next

    Dim fileObj, FSO As Object
    Set FSO = CreateObject("Scripting.FileSystemObject")
    
    For Each fileObj In FSO.GetFolder(Application.CurrentProject.path & "\libraries").files
        If FSO.GetExtensionName(fileObj.path) = "accda" Then
            Application.References.AddFromFile fileObj.path
        End If
    Next
    
End Function

Usage

To use any public function defined in the libaries, simpy call them. If there may be a case where you have the same function defined in your main project, call the function specifically from the library, for example libraryName.functionName

Current Libraries

Auth

The Auth library will provide an flexible, easy to use, authentication system for controlling access to your database.

Env

The Env library provides easy access to various windows enviroment paths/values.

Filesystem

The Filesystem library provides easy to use methods for common filesystem tasks such as creating/deleting files/folders.

Http

The Http library will provide easy to use methods for performing HTTP requests, and handling responses.

Logger

The Logger library will provide easy to use and configure methods to log errors and activity in your database.

Middleware

The Middleware library will provide an flexible, easy to use, authorization system for managing roles and permission for your database.

Outlook

The Outlook library will provide easy to use and configure methods to perform common tasks in MS Outlook.

SQL

The SQL library will provide easy to use and configure methods to perform SQL tasks (inserts, deletes, etc) in VBA for your database.

SourceControl

The SourceControl library provides an easy way to export all VBA modules in your database(s) for checking into source control. For an example, the src files in this repo were exported from their respective databases using the SourceControl library. This library is mainly to aide in the maintenance of this repo, but you may find a use for it.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Feedback

I'd love to hear your thoughts on this proposed architecture, reach out to me on twitter

License

MIT

Good Resources

ms-access-vba-libraries's People

Contributors

wyattcast44 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.