Question How to prevent a database from being copied (1 Viewer)

Big Pat

Registered User.
Local time
Today, 04:36
Joined
Sep 29, 2004
Messages
555
Hi,

Maybe this is the simplest thing going, but I have no clue how to begin.

I work in a hospital and we have a fire safety officer who has asked me to build a fairly simple database so he can log details of his audits for each ward/dept. I've almost got this ready now and I'm pretty happy with it.

Now I find out this guy doesn't actually work for this hospital, but is a fire safety Consultant, who has an ongoing contract for half-a-day per week, charging Lord only knows how much.

Now I'm concerned that he'll take my database and use it at other customers' premises and I want to prevent that. I don't need to turn it into Fort Knox, as I get the feeling his IT skills are FAIRLY basic, but is there some way of putting some code in that says something like:

"Am I installed on the hospital server? If 'Yes', OK - activate database, If 'No' display suitable message and close down".

If this is completely along the wrong track, I'd be grateful for any advice anyone can offer.

PS My skills are fairly basic too :cool: I can do tables/queries/forms/reports, but if you're going to give me some code, please tell me where to stick it :D
 
Search this forum for the topic on "Software Licenses" and variations of that theme. Several solutions have been offered on how to accomplish more or less what you want.

It is complicated, but if I recall correctly, the explanations are detailed enough for some of the better articles that you might get a hint on how to do this.
 
I think in this particular case, you can control the app without too much trouble.
1. Have the database open a startup form.
2. In the startup form's open event check the path to the database and if the path is not what you expect, display "you are not authorized...." and shut down or open the normal starting form.
3. Have the startup form hide itself so that it stays open but invisible.
4. Have each other form look for the hidden startup form with "IsLoaded" in their Open events. They should refuse to open if the hidden form isn't open. This will prevent your security from being circumvented by bypassing the shift key lock.
5. Compile the database into an .mde and distribute only that. Make sure you keep the .mdb in a safe place because there is no going back to it from the .mde.

This will not prevent anyone from copying the database, nor will it prevent them from accessing the data. It will however, make the application useless to them since they cannot use any of the forms.

ULS is another option. But, before you go down that road, make several backups and read the Security FAQ at least 3 times and follow its directions EXACTLY.
 
Thanks for your help so far folks, but I'm in danger of getting in over my head here. Pat, your approach sounds like the kind of thing I need, but I would need more help.
1) I can do that!
2) ""..check the path to the database .." How ?
3) How do I make a form open but invisible? I don't see a "visible" in the form's property sheet. Do I give it a hidden attribute? Or do you mean minimise it behind another form?
4) I'd like to see an examle of that.
5) I can do that!

As you can see I have some way to go to learn this stuff. You must have a million and one other questions to answer so I don't want to take up too much of your time. Can you point me at any examples or other threads where this kind of thing is explained?
 
2. Left(Application.CurrentDb.Name, InStrRev(Application.CurrentDb.Name, "\")) -- will give you the path without the database name. Application.
CurrentDb.Name will give you the path with the database name.
3. After your code runs, set the forms .visible property to False
4. Here's the code:
Code:
Public Function IsLoaded(ByVal strFormName As String) As Integer
On Error Resume Next
 ' Returns True if the specified form is open in Form view or Datasheet view.
    
    Const conObjStateClosed = 0
    Const conDesignView = 0
    
    If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then
        If Forms(strFormName).CurrentView <> conDesignView Then
            IsLoaded = True
        End If
    End If
    
End Function
 
Can you point me at any examples or other threads where this kind of thing is explained?

http://support.microsoft.com/default.aspx?scid=/support/access/content/secfaq.asp

there's lots of stuff to learn i'm afraid

you can also switch everything off: f11, background tables and the shift key (with code) and enable the shift key on log in, but switch it off when logging out, so that if you know to log in twice to a database, you get in

i'd say your easiest solution is an MDE with links to a back end that has a database password

and hello to Nuneaton, i was born in the George Elliot :) and regularly go back to Hinckley
 
Thanks for that Darth. Oh man! Just the headings run to 47 bullet points. I've just checked print preview and it comes to 35 pages. You're not wrong when you say there's a lot to learn!

I've got that sinking feeling that says I'm in over my head, but I suppose that's when you REALLY have an incentive to learn how to swim. I'll give it a go. It's like the t-shirt that guy on Mythbusters often wears: "Failure is always an option".

Small world though, huh? I'm at work in the George Eliot right now, on the third floor of the Maternity block, no less, where the information dept is now based.
 
If you're going to dive into ULS, make sure you have a floatation device. Make several backups of your database. Then make sure you follow the directions in the FAQ EXACTLY or you'll end up locked out of your database. I'm sure the Security FAQ mentions it but be sure to create a new work group file. Under NO CONDITIONS should you modify the system.mdw.
 
Small world though, huh? I'm at work in the George Eliot right now, on the third floor of the Maternity block, no less, where the information dept is now based.

ha you work in the exact spot where i was born :)

PM me if they got any jobs going and need an Access guru, i'm moving back next year :D
 
Thanks for that Pat. I did read a bit about ULS a while back and set up a test database giving my colleagues various permissions. I learned a bit, just enough so I know not to implement it on any important databases until I really know what I'm doing (if that ever happens!)


Darth, you really want to work for the NHS? In Nuneaton? Things MUST be bad in London!:eek:
 
Simple Software Solutions

Here is something else that you could try.

By the sounds of it the guy will be using the app on a hospital pc. If he says that he wants run it from his laptop or pc tell him he can't due to crown copywrite rules.

Make the mdb an mde as suggested or at least password protect the code.

Then use a function to obtain the name of the pc that the app is running on.

So when the app first loads its first task is to grab the name of the computer, if the name <> the name of the machine it should be running on OR your development machine then it must be an illegal copy. So get the system to prompt the user that this machine does not have a license for the application and then it quits.

Logic:
Installed Machine Name:Hosp111
Development Machine: MyDevPC

Code:
If FindComputerName() <> "Hosp111" And FindComputerName() <> "MyDevPC" Then

   MsgBox "This machine is not licensed to run this application",vbCritical+vbOkOnly,"Access Denied"
   DoCmd.Quit
End If

CodeMaster::cool:
 

Users who are viewing this thread

Back
Top Bottom