|
From: quinto via AccessMonster.com on 3 Jul 2008 10:20 Hi All Can anyone tell me how to put an expiring date in runtime? Quinto -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access/200807/1
From: Chris O'C via AccessMonster.com on 3 Jul 2008 10:43 If you put an expiration date in your program, the user can set his system date to an earlier date before opening your program and use it anyway. Not very effective. If you want to test it, create a startup form and place this in the open event. If (Date > #7/1/2008#) Then MsgBox "This application has expired." Application.Quit End If Alter the date to whatever. It will close the application after the warning. Chris Microsoft MVP quinto wrote: >Hi All >Can anyone tell me how to put an expiring date in runtime? > >Quinto -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access/200807/1
From: quinto via AccessMonster.com on 3 Jul 2008 11:08 About limiting the number of times that it can be opened is that possible? Thanks Quinto Chris O'C wrote: >If you put an expiration date in your program, the user can set his system >date to an earlier date before opening your program and use it anyway. Not >very effective. > >If you want to test it, create a startup form and place this in the open >event. > > If (Date > #7/1/2008#) Then > MsgBox "This application has expired." > Application.Quit > End If > >Alter the date to whatever. It will close the application after the warning. > >Chris >Microsoft MVP > >>Hi All >>Can anyone tell me how to put an expiring date in runtime? >> >>Quinto -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access/200807/1
From: Chris O'C via AccessMonster.com on 3 Jul 2008 12:12 The best you can hope for is to hide the value and means of accessing it. In the open event of your startup form, put this code: Private Sub Form_Open(Cancel As Integer) On Error GoTo Form_Open_Err CurrentDb.Properties("DBVersionNo").Value = CurrentDb.Properties ("DBVersionNo").Value + 1 If CurrentDb.Properties("DBVersionNo").Value > 50 Then MsgBox "This application has expired." Application.Quit End If Exit Sub Form_Open_Err: If Err.Number = 3270 Then Call setupDBProp Else MsgBox Err.Number & vbCrLf & Err.Description End If Err.Clear End Sub In a standard module put this code: Public Function setupDBProp() On Error GoTo setup_Err: Dim prop As DAO.Property Dim db As Database Set db = CurrentDb Set prop = db.CreateProperty("DBVersionNo", dbLong, 1) db.Properties.Append prop setup_Exit: Set prop = Nothing Set db = Nothing Exit Function setup_Err: MsgBox Err.Number & vbCrLf & Err.Description Err.Clear Resume setup_Exit End Function Now save and compile the code. Make the db into an MDE and distribute that. When the app is opened it will increment the counter. When it hits 51, it expires and the app closes every time afterward. To circumvent your efforts, all the user has to do is reinstall your app and start the counter all over. Not very effective. If he's clever with Access, he could check the db properties and find a user defined one named DBVersionNo and reset it to zero every time the app expires. Not too many are clever with Access but they don't really need to be. Chris Microsoft MVP quinto wrote: >About limiting the number of times that it can be opened is that possible? > >Thanks > >Quinto > >>If you put an expiration date in your program, the user can set his system >>date to an earlier date before opening your program and use it anyway. -- Message posted via http://www.accessmonster.com
From: quinto via AccessMonster.com on 3 Jul 2008 14:51 Thank you all for the vauable information Quinto Chris O'C wrote: >The best you can hope for is to hide the value and means of accessing it. In >the open event of your startup form, put this code: > >Private Sub Form_Open(Cancel As Integer) > > On Error GoTo Form_Open_Err > > CurrentDb.Properties("DBVersionNo").Value = CurrentDb.Properties >("DBVersionNo").Value + 1 > > If CurrentDb.Properties("DBVersionNo").Value > 50 Then > MsgBox "This application has expired." > Application.Quit > End If > > Exit Sub > >Form_Open_Err: > > If Err.Number = 3270 Then > Call setupDBProp > Else > MsgBox Err.Number & vbCrLf & Err.Description > End If > > Err.Clear > >End Sub > >In a standard module put this code: > >Public Function setupDBProp() > > On Error GoTo setup_Err: > > Dim prop As DAO.Property > Dim db As Database > > Set db = CurrentDb > Set prop = db.CreateProperty("DBVersionNo", dbLong, 1) > db.Properties.Append prop > >setup_Exit: > > Set prop = Nothing > Set db = Nothing > > Exit Function > >setup_Err: > > MsgBox Err.Number & vbCrLf & Err.Description > Err.Clear > Resume setup_Exit > >End Function > >Now save and compile the code. Make the db into an MDE and distribute that. >When the app is opened it will increment the counter. When it hits 51, it >expires and the app closes every time afterward. > >To circumvent your efforts, all the user has to do is reinstall your app and >start the counter all over. Not very effective. If he's clever with Access, >he could check the db properties and find a user defined one named >DBVersionNo and reset it to zero every time the app expires. Not too many >are clever with Access but they don't really need to be. > >Chris >Microsoft MVP > >>About limiting the number of times that it can be opened is that possible? >> >[quoted text clipped - 4 lines] >>>If you put an expiration date in your program, the user can set his system >>>date to an earlier date before opening your program and use it anyway. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access/200807/1
|
Pages: 1 Prev: Requery not update until 2nd record? Next: Subform and Main From calucation |