Re-distribute VBA functions securely

BiigJiim

Registered User.
Local time
Today, 15:32
Joined
Jun 7, 2012
Messages
114
Hi,

Can someone tell me the best way to achieve this. I have an Access 2007/2010 database containing a library of functions which I want to be able to distribute to a team of developers to use. It is important that they can call the functions in the database from within their own applications. However, it is vital that they cannot see the code or edit it in any way.

I have looked at simply creating an accde file of my database. My team can then add a reference to that file from within their own applications. The downside to doing this is that every installation of their applications then requires a reference to the correct location of the access accde file. Is there a better way of doing this?

Many thanks for reading, and for any help you can give,

Jim
 
You can install your db at the same folder as their db. No need to fix the reference.
 
out of interest, I tried to find a way to install a library at a relative reference - so for instance you could put in the same folder as the code database, and automatically link to it. (currentproject.path)

I was not able to achieve this, and had to put it in an absolute path, which then becomes awkward. Is there a way of using a relative path?
 
I have a reference to a dll.
As long as it is in the same path as my db it will find it correctly.
 
You can install your db at the same folder as their db. No need to fix the reference.

Smig, that's brilliant. I should have tried this first, but Microsoft's documentation seems to imply that it doesn't look there when trying to fix the reference.

out of interest, I tried to find a way to install a library at a relative reference - so for instance you could put in the same folder as the code database, and automatically link to it. (currentproject.path)

I was not able to achieve this, and had to put it in an absolute path, which then becomes awkward. Is there a way of using a relative path?

I just checked with what Smig said Gemma, and it looks like if you drop the file in the same folder as the application db, then Access takes care of it for you.

This might also be of use to some people.
http://www.fmsinc.com/MicrosoftAccess/modules/code/GeneralVBA_VB6/References/References.htm
 
I have a reference to a dll.
As long as it is in the same path as my db it will find it correctly.

how do you declare the reference then?

let's say I have a database in

C:\folder1 - so I have code.accde and library.accde

and another guy does the same, but puts his in folder

D:\workfolder.


How do you declare the reference to the library.accde in the code database, and have the code dbs find it, wherever the databases are located?

can you just say the library is in folder X:\dummy, and "know" that the dbs will find in currentproject.path regardless?

that would be sweet because then you could issue open code databases, but keep certain elements safely protected.
 
can you just say the library is in folder X:\dummy, and "know" that the dbs will find in currentproject.path regardless?

that would be sweet because then you could issue open code databases, but keep certain elements safely protected.

Dave, that seems to be the case. I had my app db and my library db in C:\FolderX. I created the reference in my app db. I then moved both files to D:\FolderY. Without doing anything else I ran the app db and it worked fine - no broken references!

I have also now worked out that if you need to reference any DAO objects in the library db, you need to use CodeDb instead of CurrentDb. We are getting there!
 
how do you declare the reference then?

let's say I have a database in

C:\folder1 - so I have code.accde and library.accde

and another guy does the same, but puts his in folder

D:\workfolder.


How do you declare the reference to the library.accde in the code database, and have the code dbs find it, wherever the databases are located?

can you just say the library is in folder X:\dummy, and "know" that the dbs will find in currentproject.path regardless?

that would be sweet because then you could issue open code databases, but keep certain elements safely protected.
From my experience you only need to refernce once. As long as all files are located together it will work :)
 
BigJim and Smig

Thanks both for the pointer about the reference. I will have a go.

What I really hoped to do was produce a "locked" private library that could be included and distributed within an open db file. I am sure I can build a licensing scheme into the library to protect it.

I had already worked out many of the subtle effects of trying to deal with codedb and currentdb, even to being able to use private tables within the library dbs.
 
What I really hoped to do was produce a "locked" private library that could be included and distributed within an open db file. I am sure I can build a licensing scheme into the library to protect it.

Exactly what I have just done Dave. This is for a licencing product I already developed, where each machine an access application is installed on requires its own licence key. Licence keys are generated by a companion tool which uses the machine ID of the installation pc and a date formula to generate a licence key which can be indefinite or expire after a certain time (eg. monthly subscriptions.) Optionally it prevents access applications being copied from one machine to another.
 

Users who are viewing this thread

Back
Top Bottom