Solved

Protect Access program

Posted on 2014-04-25
12
508 Views
Last Modified: 2014-05-16
I have developed a program in Access2010.
I would like to protect it from copying the source.
How to protect the piracy?

What is the normal procedure to protect copying?
Is it possible to give them as an exe with the source codes protected?

And there is user authentication.
How to control the number of user?

I want only 2 users to be logged in at a time.
0
Comment
Question by:-MAS
  • 5
  • 4
  • 3
12 Comments
 
LVL 57
ID: 40022452
With Access, you cannot generate a standalone EXE.

You can distribute your database with a password on the VBA project to protect the source code.   In addition, you can also distribute as a "compiled" app, which is a MDE.  This is a DB with the source code stripped out.

Even with all that however, someone who is very determined could still figure out your code.

To help with that, you could use:

http://www.everythingaccess.com/mdeprotector.htm

In terms of registering/securing your app from a licensing standpoint, there is this:

http://www.peterssoftware.com/ka.htm

Jim.
0
 
LVL 84
ID: 40022539
And there is user authentication.
How to control the number of user?
I want only 2 users to be logged in at a time.
You'd have to control that yourself. Essentially, you'd have to log users when they connect, and log them out when they disconnect. This can be tough to do, especially if you have users who are in the habit of using the power button on their machine to log out.

What's the reason for having only 2 users? If this has to do with licensing, then I'd suggest something like what JimD suggest, or this: http://www.ssware.com/cryptolicensing/cryptolicensing_ocx.htm. This is an industrial strength library that will do what you need. I use it for my .NET projects, but I've used the ActiveX version as well.
0
 
LVL 24

Author Comment

by:-MAS
ID: 40033878
I have user authentication.
But not sure how to control that. I have a table to store username and password.
0
 
LVL 84
ID: 40034204
Not sure how to control what?

If you only want two users in the database, then when User1 logs in you would write a record somewhere (perhaps you'd have a Logins table). When User2 logs in, you check the Logins table to see the number logged in. If it's less than 2, you allow User2 to log in.

When User1 logs out, you either remove that record from the Logins table, or you "close" it (i.e. stamp it with the logout date/time).

The trouble comes when User1 doesn't log out, but instead uses the power button on the machine to close it out, or when the network drops, or any of a dozen other scenarios. When these happen, the Logins table is not updated, and the system will consider User1 to still be logged in.

So back to my comment:

What's the reason for having only 2 users
If you can let us know why you only want two users logged in, we might be able to provide you with better suggestions.
0
 
LVL 24

Author Comment

by:-MAS
ID: 40034220
I started with 2 users. Now they are telling me to give them a user with admin permission to create another user so only 2 users can login at the same time.
Note: I told them you can keep only upto 4 active users.
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 40034241
Okay, then the technique I suggested would be a good starting point - but as I mentioned, there are quite a few pitfalls with this technique. You would be much better off with a commercial licensing utility that sits outside of the program, and monitors activity. The utility I suggested (CryptoLicensing) does these things, but it's not free (or cheap, for that matter).

I'm also curious if you could use the Jet Roster method for this:

http://www.fmsinc.com/MicrosoftAccess/monitor/database-users.htm

Basically, this "reads" the lock file and determines the number of users in the system. Note that connecting to the lockfile will create a user, so you'd have to account for that  -  - in other words, if two users are in the system and you use the Jet Roster method, it would show 3 users, not 2. You could modify the VBA code sample from that page like this:

Dim iCount As Integer

With rstTmp
    Do Until .EOF
       iCount = iCount + 1      
      .MoveNext
    Loop
End With

If iCount > 3 Then
  Msgbox "More than 2 users are not allowed"
  Application.Quit
End If
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 57
ID: 40034248
The comments that Scott and I posted at the start contain everything you need to protect your app and control the number of users.

Note that were assuming that you telling them they can only have 4 users is a restriction you want and not a problem with the app.

 A well written Access app can handle 30 to 40 users without issue and if a SQL server backend, more than that.

Jim.
0
 
LVL 24

Author Comment

by:-MAS
ID: 40055498
One more thing I have seen one of my friend did this. He just run the exe automaically a shortcut created on desktop and db copued to c drive. I think he just coped the shortcut and and copied the db and created as a package in VS2010.
I am not sure of how he did that or he got it from somewhere else.
Any idea of how it will be?
0
 
LVL 57
ID: 40055894
With Access, you cannot create a standalone .exe

Either the Access run time or the full Retail version must be installed in order to use the DB (they are in fact one in the same, it's just some registry keys that controls the "mode" your allowed to use it in).

I would assume what your friend did is created an install package that included the run time version of Access along with the DB.

Jim.
0
 
LVL 24

Author Comment

by:-MAS
ID: 40056897
Yes you are right I saw first it installed runtime and copied the DB.

How to do the same?
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 250 total points
ID: 40057239
<<How to do the same? >>

There are a couple methods:

1. Manual - Point them to the runtime download on Microsoft's site and then give them a copy of the DB with instructions to install.

2. Create an install package with:

a. VS as your friend did.
b. The Access publish wizard (leaves lots to be desired, which is why your fired probably used VS).
c. Many use INNO setup with good results (http://www.jrsoftware.org/isinfo.php and it's free).
d. Purchase Sagekey scripts.

 The last d, is the most preferable.  Sage has been around for a while, and their install is first rate.  It gives you a totally isolated install from anything else that may be installed on the machine.  Your app will work every time no matter what else that's Access based has been installed there.  Details here:

http://www.sagekey.com/installation_access.aspx

Jim.
0
 
LVL 24

Author Closing Comment

by:-MAS
ID: 40071752
Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now