Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 24th, 2005, 01:13 AM
Authorized User
 
Join Date: May 2005
Location: Newark, Ohio, USA.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Security

I have spent a month writing a maintenance database PM system for our maintenance department at work. I would like to sell it to them.

My question is can I secure this program so that:

1. It will run for 60 days then require the one time entry of a password to unlock it?

2. Prevent the program being copied to another computer or Disk?

Any help would be appreciated

Mike Drumm


Reply With Quote
  #2 (permalink)  
Old July 29th, 2005, 10:25 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Yes and yes.

You can hide a table with the date of the installation stored. Then a query comparing the date to today's date on start up. Then code that runs when the query value exceeds 60 days. Have it check the value on start up, then have it open another form (different from the regualr start up form) on start up after 60 days that requires a password. If the password is not entered then quit the application. You could also do a splash form that shows the user how many days are left in the free trial.

You can also hide another table to store the computer name (or better, serial number). Then check the current SN against the table value. If they don't match then quit the application.

Make the file an mde to prevent access to your code.

HTH


mmcdonal
Reply With Quote
  #3 (permalink)  
Old July 29th, 2005, 10:35 AM
Authorized User
 
Join Date: Jun 2004
Location: , , USA.
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dude that is wicked

"Life is a Database"
Reply With Quote
  #4 (permalink)  
Old August 2nd, 2005, 01:57 AM
Authorized User
 
Join Date: May 2005
Location: Newark, Ohio, USA.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by MDrumm
 I have spent a month writing a maintenance database PM system for our maintenance department at work. I would like to sell it to them.

My question is can I secure this program so that:

1. It will run for 60 days then require the one time entry of a password to unlock it?

2. Prevent the program being copied to another computer or Disk?

Any help would be appreciated

Mike Drumm


Reply With Quote
  #5 (permalink)  
Old August 2nd, 2005, 02:10 AM
Authorized User
 
Join Date: May 2005
Location: Newark, Ohio, USA.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

mmcdonal Thanks for your reply
However I am not sure how to get a computers serial number into a table. Or how to make a hidden table. Would you have an example. I have been writing VB code under buttons and on events like form load. Sorry I am a beginner.




Quote:
quote:Originally posted by MDrumm
 I have spent a month writing a maintenance database PM system for our maintenance department at work. I would like to sell it to them.

My question is can I secure this program so that:

1. It will run for 60 days then require the one time entry of a password to unlock it?

2. Prevent the program being copied to another computer or Disk?

Any help would be appreciated

Mike Drumm


Reply With Quote
  #6 (permalink)  
Old August 2nd, 2005, 07:08 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

A beginner selling a database already? Get ready for the service calls. They happen no matter what your level of experience is.

Okay, to make a table hidden, right click on the table (or any object in the database) and select Properties. Check the Hidden check box, and click okay.

You will probably want to code the database to ignore the shift key on start up as well, and make sure the database window does not pop up on start up.

To get the serial number of the computer, use this code:

'----------
Dim stSN As String
Dim objWMIService
Dim strComputer As String
Dim objItem
Dim colItems

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystemProduct", , 48)
For Each objItem In colItems
    stSN = objItem.IdentifyingNumber
Next

'----------

Then compare the variable to the SN you entered in the hidden table.
If they don't match, then quit the app.

To view a hidden database object, go to Tools>Options>View tab, check Hidden Objects, and click Ok.

You can do the same thing for the date.
Create a hidden date table, then enter the end date of the installation/trial.

Capture the current date, then compare it to the date in the hidden table in the modal splash form On Open event. If the Current Date is > the hidden date, then close the splash form and open a modal login form. Ask for the password and then set the date in the hidden table to 12/31/9999 in the hidden table if the proper password is entered.

Make this an MDE file so you can hide the code that contains your password.

HTH


mmcdonal
Reply With Quote
  #7 (permalink)  
Old August 2nd, 2005, 08:57 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Now that I think of it, you can store the serial number and date installed in code, and then check the sn and current date against those coded values rather than using a hidden table. Like in the code on your splash form:

'----------
Dim stSN1 As String
Dim stSN2 As String

stSN1 = "CQZXN71"

'Then insert code to find the current machine's SN as above.
'Then compare stSN1 and stSN2

If stSN1 <> stSN2 Then
   Application.Quit
   Else
   DoCmd.OpenForm "frmMainSwitchboard", etc...
End If
'----------

You can do the same with the end date of the trial period.
If the app is an mde, then no one can see the code.

HTH

mmcdonal
Reply With Quote
  #8 (permalink)  
Old August 2nd, 2005, 09:53 AM
Authorized User
 
Join Date: Jun 2004
Location: , , USA.
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I remember once disabling the shift key. I left a very small hidden button that would enable it again. Problem is, I forgot where the button was. I could not edit the database. Finally, I used Visual Basic.Net to enable the shift key property.

Does this mean that there is no ABSOLUTE way of locking an Access Database?

"Life is a Database"
Reply With Quote
  #9 (permalink)  
Old August 2nd, 2005, 10:21 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

If you open the database and then hit the f11 key, this will make the database window appear. No need for VB.NET.


mmcdonal
Reply With Quote
  #10 (permalink)  
Old August 2nd, 2005, 10:23 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Ooops, there is a need for VB.NET. That is the only way of locking up a front end... or using a web front end.

You can hide all the database objects, and hide the toolbars, and disable the code with an mde. But if you want to close things up for sale, you should do more than that. If your clients are going to try to backward engineer your stuff you need a vb.Net front end for client/server.

mmcdonal
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Access Security & Role Based Security robzyc C# 6 April 11th, 2008 02:31 AM
System.Security.SecurityException: Security error coolcatjk Pro VB.NET 2002/2003 4 March 2nd, 2006 06:00 PM
Security deys C++ Programming 0 February 2nd, 2006 02:33 AM
security mjuliao Access 1 October 16th, 2005 12:13 AM
Security qa BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 8 June 28th, 2004 11:00 AM



All times are GMT -4. The time now is 10:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.