Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Trial Period

how would you do a trial period of a program? Like could you make it so that it gets the date the program is installed or first runs and count down the number of days? then make it so that the user cant use the program with out registering?

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Trial Period With Password
I need a code for Excel made in VB6. It would be for sheet1 only. I want to put a time trial on it. I would like to make this work with dates not number of times used. I would also like to incorporate a kill code. I have found a few post on trial periods. When I try these codes I am never given a place to enter a password. It just kills the sheet or hides it. I would like that on a certain day that I specify a popup would appear saying "trial period over please enter password to continue". There would be a spot to enter the password, and if entered correctly would unlock it for a specified amount of time like before then ask for the password again in the future. Thank you for any help you can offer.

Trial Period On Status Bar
Hey, im using this code for a free trial

VB Code:
Dim firstRun As StringDim diffNum As IntegerDim s As String firstRun = GetSetting("AppName", "Options", "FirstRun", "0") If firstRun = "0" Then    MsgBox "Thank you for installing my product.  You have 15 days to use this."    SaveSetting "AppName", "Options", "StartDate", Date()    SaveSetting "AppName", "Options", "FirstRun", "1"Else    s = GetSetting("AppName", "Options", "StartDate", "01/01/01")        diffNum = DateDiff("d", s, Date())     If diffNum > 14 Then           MsgBox "This program has been installed for " & diffNum & " days.  You must register.", vbInformation, "AppName"           Exit Sub    Else            MsgBox "You have " & 15 - diffNum & " days left before the program is disabled."    End IfEnd If

I want to use a status bar to display the period of the trial. So when 15 days are remaining the status bar is full but when the trial has ended the status bar is empty...

How To Make Trial Period
What is the best way to make my application expired at certain date ?
Registry change ?
Thank you all !

Function For 30-day Trial Period Not Working Correctly. [SOLVED]
VB Code:
Private Sub CheckTrialTime()    Dim StartDate As Date    Dim EndDate As Date    Dim DaysLeft As Integer    On Error GoTo SetTrialProperties    DaysLeft = Format$(days360(StartDate, EndDate), "##") & " day(s)"    MsgBox "You have " & DaysLeft & " days left in your trial.", vbInformation, "Trial version"    Exit SubSetTrialProperties:    Set Win32Script = CreateObject("WScript.Shell")    StartDate = Now    EndDate = Now + 30    Win32Script.RegWrite "HKEY_LOCAL_MACHINESOFTWARESparkFTPMain SettingsTrial Begin Date", StartDate    Win32Script.RegWrite "HKEY_LOCAL_MACHINESOFTWARESparkFTPMain SettingsTrial End Date", EndDate    Set Win32Script = Nothing    Resume NextEnd Sub Private Function days360(dt1 As Date, dt2 As Date) As Long    Dim z1 As Long, z2 As Long    Dim d1 As Long, d2 As Long    Dim m1 As Long, m2 As Long    Dim y1 As Long, y2 As Long    d1 = Day(dt1)    m1 = Month(dt1)    y1 = Year(dt1)    d2 = Day(dt2)    m2 = Month(dt2)    y2 = Year(dt2)    If d1 = 31 Then        z1 = 30    Else        z1 = d1    End If    If d2 = 31 And d1 >= 30 Then        z2 = 30    Else        z2 = d2    End If    days360 = (y2 - y1) * 360 + (m2 - m1) * 30 + (z2 - z1)End Function

This outputs the correct starting and ending dates, but outputs "You have 0 days left in your trial." inside the message box. What's wrong?

Creating A Demo Copy Of A System W/ A Trial Period
Good day! I have created a system which will require it to be used for a limited no. of days only (say one month) after installation. After that period, the system will cease to run. Even if the user deletes the installed file(s), the system must detect that it has been installed in the same PC before and so must not be able to run even after reinstallation. Does anyone here have an idea on how to implement this? I have an idea but I'm not sure on how to implement it. Will a database or an external file be needed to store the installation date?

I would also like to ask something else. Suppose I have a .vbp file consisting of several .frm and .frx files. Will my files be affected if I rename my .vbp file? For instance, I want to save My_VB_Project.vbp as MyProj.vbp.

Thanks in advance!

Creating Conditional If Trial N = X And Trial N-1 = X
Hi everyone,
I'm using visual basic 3 to do some data analysis. I already am using a VBAB program which takes my data and creates a variable called "trial" which represents which trial it is in 450 trials and a variable for reaction time on each trial and a variable for type of code (code x, for example, specified depending on RT characteristics in my current program).
What i need to do know is get RT data from instances when I have trial N = code X and trial N-1 = code X (i.e. the previous trial and current trial are both trial type X), then output new variable "code Y". I looked through VBAB help and could not find information on marking data if i conditionalize based on current and previous characteristics on a given two trials.
Any suggestions?

Thanks a bunch!

Is there a vbdefault or keyword for a period?

I want to only allow entering numbers and or a period in a text box (a percent). I can do it for numbers but what is the code for a period? Should I just use the ASCII representation ?

how i put period between 1action and 2action


Period Ascii
Anyone know it...

VB Code:
If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 And KeyAscii <> 13 Then KeyAscii = 0

I only want to allow for numbers, the enter key, the tab key, or a period.


CDO Period Stripping
I have problems with CDO

I does not matter if I use CDONTS or CDOSYS

Dim iMsg
Dim iConf
Dim Flds

set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
Flds("") = "localhost"
Flds("") = 1

With iMsg
Set .Configuration = iConf
.To = ""
.From = ""
.Subject = "Sample HTML message..."
.TextBody = "<A HREF=""HTTP://999.999.99.99/onetest.asp?File=someordinarasimple_normal.pdf&dfgdgdsf=dfgsfdgdsgfdggdsfgs""> fdshkf sdjkf hdskjfhjkdshf ksjdhf kfksd klgkdfgfjd gjfkldj gljfldjg lfdjglfjdglkd fgjdsf gljdgjfd</A>"
.HTMLBody = "<A HREF=""HTTP://999.999.99.99/onetest.asp?File=someordinarasimple_normal.pdf&dfgdgdsf=dfgsfdgdsgfdggdsfgs""> fdshkf sdjkf hdskjfhjkdshf ksjdhf kfksd klgkdfgfjd gjfkldj gljfldjg lfdjglfjdglkd fgjdsf gljdgjfd</A>"
End With

Dim myMail
Set myMail = CreateObject("CDONTS.NewMail")

myMail.From = ""
myMail.To = ""
myMail.Subject = "TEST MAIL"
myMail.Body = "<A HREF=""HTTP://999.999.99.99/onetest.asp?File=someordinarasimple_normal.pdf&dfgdgdsf=dfgsfdgdsgfdggdsfgs""> fdshkf sdjkf hdskjfhjkdshf ksjdhf kfksd klgkdfgfjd gjfkldj gljfldjg lfdjglfjdglkd fgjdsf gljdgjfd</A>"
myMail.BodyFormat = 0
myMail.MailFormat = 0

Set myMail = Nothing

In either case the period in the File parameter is stripped by CDO so the link will be:


What to do???

Silent Period
How to detect the silent period (sound card no wave)?

Apportion A Given Period
How can I code a program to apportion a given period.

Input : 1.1.2001 to 30.04.2002

Output : 1.1.2001 to 31.12.2001
             1.1.2002 to 30.04.2002

Thanks for your kind assistance

Doing Certain Jobs For A Certain Period Of Time..
sorry for this newbie question...

is there any way that i can do so?

For example i wanna keep doing dummy=DoEvents() for 3 seconds, then I will continue doing things below that...

how can I code this?

Trail Period Enforcement
What's the best way to enforce trial periods, and then disallow use of the software after a certain time?
Does it have to do with the system registry?
Let's say for example I wanted to a 30 day trail registry, and then not let the user use the software anymore after popping up an explanatory window.

Program That Tells What Period I Should Be In
I want to code a program that will say Periods 1-9 depending on what time of day it is. I wanna do this for my parents, so they know what periods its safe to call my cell phone. But how would i do this?!!?!?!?

How Can I Suspend A Function During A Certain Period?
Hello to all,

Within the framework of my training course of end of studies, I am brought to make an interface in vb net communicating with a db access (

Safety devices (alarms sets fire to, etc...) are going to set informations in a db access and Iím charged of making an application allowing at any moment to visualize the state of these various devices and in the long term, to be able to modify their states.

At the time I have a value different from 0 for a sensor I must emit an aural signal, another signal with a different tonality if the value is higher than 2 and one third if value is higher than 3.

This signal resounds as much as the state of the entries of the sensor is not 0. The aural signal must be able to be cut for a period of 30sec and I do not see how to do that.

For the moment I use timers. The sweeping of the various decentralized units is carried out all the 100ms. I thus have the call of my function sweeping which is at the level of the actions carried out by the timer1.

During this sweeping, I must be able to emit an aural signal. The call of my function, SelectSound, making it possible to select the sound is located in my function of sweeping. My SelectSound function goes according to the value recovered on my decentralized unit, to start a timer (timer2, for a value=1, timer 3 value=2....) which contains the call of my PlaySound function. Until there all functions.

Now I must be able to suspend the execution of these timer for a certain period but I must continue to sweep the d.u.. And it is there that my problem is.

How can I do that? Is the use of the threads justified in my case? I tried to place my SelectSound function in a thread and to start my thread in my function of sweeping, but my sound is not played any more. The program however returns well in my SelectSound function.

Thank you in advance for your assistance

Rolling 6 Month Period
I have a table that records login and logout entries for the reps that work in our phone department. When a rep misses a day, it is considered an negative performance occurrence. Each rep is given a warning when he/she reaches 4 occurrences within a 6 month rolling period. For example, the rep is late on 1/1/2005, 2/3/2005, and 3/2/2005. If the rep misses a day after 7/1/2005, the rep will still only have 3 occurrences within the 6 month rolling period (2/3/2005, 3/2/2005, and the newest entry). I'm trying to design a query that captures this dynamic environment, but I can't seem to find a good start. I've tried searching for the count of entries using a subquery. The main query searches for a date that meets the absence criteria (displayed field), then returns a count of entries that contain the absence criteria between the date of the first entry and a date 6 months in the future. Any ideas?

Best Way To Pop A Reminder Over Long Period?

Access database holds a date which the user has input using the Monthview Control, another field calculates the next date the user needs
to visit for an oil change, engine repair etc. anywhere from 3 months to 2yrs which is in date from MM/DD/YYYY.

I want to put that next date into a pop up reminder, and give the user an option to pick another Date/time.

Been looking at the timer control, seems crazy to have that thing ticking away for years, is there a better way?

Also how would I tie the reminder date MM/DD/YYYY to trigger the timer control, and have multiple reminders?

Is there any third party timer controls that you recommend? or a better way?

KeyAscii Code For A Period
I have this in the keypress event of a control to prevent anything but numbers from being entered. However, I do need to allow decimal numbers, so what would I add as the keyascii for a period as being an allowable characters?
VB Code:
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 46 And KeyAscii <> 13 Then    MsgBox "Only numbers are allowed for this entries.", vbOKOnly + vbExclamation, "Letters Are Not Allowed"    KeyAscii = 0    Exit SubEnd If

Allow Numeric, Comma (,) And Period (.) Only
Hello, I want to just allow the user to type numberic value and a period just like typing money figure like $1.25.

my code for the moment is this

VB Code:
If KeyAscii = vbKeyBack Then 'backspace    Exit Sub  ElseIf KeyAscii = 13 Then 'or vbkeyreturn    txtPurchasePrice.SetFocus  ElseIf KeyAscii < 48 Or KeyAscii > 57 Then  'Allow Numeric only    KeyAscii = 0  End If

How Can I Change A Txt Box Over A Period Of Seconds?
so when I click a command, in the txt box it will say i.e. "just checking"

then 5 seconds later "checked"

txtDisplay.Text = "just checking"

then what? can it be done?

thanks very much

Current Fiscal Period
Is there a way to find the current fiscal period?


Set Query Over Period Of Time
I've got a query that brings up all parties booked but my client wants to find the number of bookings for a certain month. I'm not quite sure how to set this up. Does anyone have any ideas on how to do this?


Summer Time Period
Hi vb-world:

I need to detect the summer time period or take the date of the first sunday of april and the last sunday of october, how can do that?.

Thanks in advance and regards.

String Seperation With Period
I have a string...

NewString(0) = "File1.txt"

I need to seperate it to


But I dont need it stored ..
Just need to code so the
computer sees it without
storing it..

How can I do that?

Something like this:

If BeforePeriod(String1(0)) = "Text1" then
end if

How Do You Limit The Period In A Textbox
example: $9.99.99 <--shouldn't allow 2 periods.. >.<

Clarification On The Period Before A Word
Could someone please clarify for me what is the significance of usingthe "." before a word. For example in the statement "If .Execute then". What does the period before the Execute imply. I appreciate anexplanation in this regard.

Thanks for your time.

VB6 - TextBox - Period/comma

I have a small accounting programa.(I am studing on it)
I have a TextBox to enter the numbers.When I use a comma (,) before of the
cents everything works well, but if I use the period (.) before the cents I
get a wrong number.

Ex. If I enter 10,10 ( with comma) I get 10,10 what is ok.

Another Ex: If I enter 10.10 (with period) I get 1010,00 what is wrong.

Any help to solve this problem.

My Code is :

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
SendKeys "{tab}"

If Text1.Text = "" Then
Text1.Text = 0
End If

If Text1.Text = "" Then Exit Sub

If Not IsNumeric(Text1.Text) Then Text1.Text = 0

Text1Text = Format$(Text1.Text _
, "###,###.00")

End If

End Sub


Lock Vb App After Inactivity Period
Has anyone some code / references how to find out how long a program has been inactive (no clicks / form focus)?

I'm using vb6 and mdi forms.

Most answers seem to say just a timer with a reset for every text box and click etc. However, this is a lot of code to put in and won't work for MDI forms with no mouse events.

I.e. If my program receives no activity for 15 minutes because the user walked away or is using another app on the system (so different to the screensaver starting), I want to display a log in form.


Thank you,


Logging Out After A Period Of Inactivity
I have developed a database application in VB6, where users log in/out...I want the system to log out a user automatically after a certain period of inactivity....How do I accomplish this?

Free Software Period.
Hello everyone,

Please come to visit a small and new Internet search engine and software company at and downloads free software. You will find everything you need from Microviet Internet Search Engine Web site.

You will get absolutely free:

A. Free Microviet OneStop Web Browser

1. Try this new Web browser. It's small and fast.

2. You can search everything from Internet Web sites without go to Yahoo, Excite, AltaVista, and etc.

3. You be able to use seven different languages at the same time (English, French, German, Italian, Portuguese, Spanish, and Vietnamese)

4. You be able to launch Netscape or Internet Explorer Web browser within Microviet OneStop Web Browser

B. Free Microviet Ikids Web Browser

1. Special designs just for Kids. It's small and fast

2. Bullet Proof Web browser.

3. Now, parents and educators wonít have to worry about their children or students accessing inappropriate web sites in the Internet.

4. Disclaim

C. Free Business Listing

D. Free Source code: Perl, CGI, JavaScript, Java, Visual Basic, Visual C++, and Visual J++

E. Free a lot of software from other

F. Will be available soon.

1. Free Microviet Word Process

2. Free Microviet Small Business Database

3. Free Microviet Household Database

4. Free Microviet Personal Calendar

You have nothing to lose. Just come to take a peek!

Click on downloads free software!


Nam H Nguyen

Auto Run Cd With Trail Period
I made an application in VB. i want to made this application to run automatically when we insert CD. before running the application this it has to show and work for only 30 free trails only, after that application shouldn't execute or after the application it has to validate for 30 days trail only. how can i do it?
thanks & regards

Delete File After Period Of Time
Hello every one

How i can delete file after 7 days, i mean: i will send file to my friends with VB file to delete it after 7 days.

and during the 7 days they can't delete it or copy it ( if that possible ).

i'm using visual basic 6


Calculating Price From A Period Of Time
Hi, I am currently exploring vb..and somehow stuck on this question posted to me by my friend.

Lets say I want my program to calulate exchange rates base on certain period of a year. Example:

At the month of March and Decemeber the exchange rates will be at 130% while for the remaining month it will be of the normal range.

So how am I going to get the data from the txt file using random access and read the data and then using the same "normal range" and predetermine the exchange rates base on my txt file "normal range" price and the date.

Can someone help me? I am so stuck at it. Thanks..

Converting ESC To Period In Generic Printer
I have an application that requires printing labels to a Label Printer. The control of this printer requires the use of the ESC char. The problem that I am experiencing is that when command is sent to this printer with an ESC embeded in the command, it is replaced with a period. And the printer does not know what to do with it. So, to re-state this problem, How can I send and ESC char thru the Windows Printer object? Any and all Help is deeply appricated.

How To Calculate The Period Of Time For A Loop
I have a simple running loop in my code, which is shown below

Do While ((recieved_data <> "ACK") And Not (time = 300000))
recieved_data = MSComm1.Input
time = time + 1

Is there any way of calculating how long this count will take, maybe using the speed of the computer to calculate the time the loop goes for. Using a stopwatch, this loop takes on average 3.55 seconds.

And before you mention a timer, they don't work when your using a do while loop. They just can't seam to be accessed.

Jumping Out Of A Do While Loop After A Period Of Time
Below is a simple piece of code and it works fine. We send a command to the robot to turn right. When the robot turns, it sends back an acknowledgement. I dont want the program to send anymore commands till the robot is ready. So I wait in my do while loop for the ACK. However sometimes the ACK is lost and therefore I am trapped in my do while loop forever. Is there some way I can set a timer inside the do while so that after a period of time, I can jump out of the loop. Could we use a timer and once thats finished then use the do events command to pass control back to the user??
any ideas would be grateful.

Private Sub pulse_right()
MSComm1.Output = "h"
sent_txt.Text = "PULSE_RIGHT"

Do While (recieved_data <> "ACK")
recieved_data = MSComm1.Input
MsgBox "Received ACK"
recieved_txt.Text = recieved_data
End Sub

Retrieve Number Of Equipments In A Certain Period
Hi guys,
I have the following:
A table filled with reparations records from a maintenance department. The rows contain ofcourse all different kind of info, for example, customer name, the date the equipment came into the maintenance department, the date the equipment returns to the customer, product classe etc.
I want to know the following:
- The number of equipments that came into the department in a certain period;
- The number of equipments that went back to the customer in a certain period;
- The difference between these to numbers (in order to measure the difference in stock);
- Group by product class.

I figure that the result will look something like this:
Product class | Number IN | Number OUT | Difference
A | 3 | 3 | 0
B | 8 | 5 | 3
C | 4 | 2 | -2

Any suggestions??

Thank you in advance

How To Lock A Program After A Limited Period ...

How can I lock my project after 30 days. What I mean to say is, all the controls on formMain should be disabled after exact 30 days. My project has no login page and I am using MS Access database.



Delete File After Period Of Time
Hello every one

How i can delete file after 7 days, i mean: i will send file to my friends with VB file to delete it after 7 days.

and during the 7 days they can't delete it or copy it ( if that possible ).

i'm using visual basic 6


Are There Keycodes For Keys Like Comma, Period, Etc.?
I looked in my MSDN under keycodes and saw the ones for the letters, numbers, etc. But I did not see any for commas, periods, etc. Are there none for these keys? I am trying to read then with GetAsyncKeyState.


Winsck Disconnects After A Period Of Time?
(Before I get to far...........YES...I have already asked this question once before but the probl1em was a little different, I needed help trapping the winsck errors.)

I have written a chat program that is having a little trouble. For some reason the client and server will get disconnected after a period of time. At least I think they get disconnected but the msgbox in the connection close sub doesn't popup? When the two have set idle for an extended period of time and the client tries to send data to the server the server pops up the following error:
"Subscript out of range"

Is there some sort of time out settings on the winsck control or should the connection remain until one end disconnects? Is there something I can do to maintain a persistant connection between the two?


Set Time Period To Execute A Command In VB
Is there a better way to automatically execute a procedure as the time specified by the application user ? I was thinking of using the timer to check the system time and compare to the time set by the user (my project will try to give the user to set instead of hard coded) to execute......I know it sounds silly...........

Exe To Be Expires After Stipulated Time Period

I developed an data entry application. I packed my exe and i am
suppose to provide it to my vendors. I want to ensure my
software not to be misused. So i want to write code in such a
way so that the exe should not work after the time period. I
should have the control of the exe.Is there is any way for my
problem to be solved? Please assist me.

Commssion Slab Not To Be Duplicated For The Period
Hi ,
This is an access table content
CommKey Desig minamount maxamount commrate startDate EndDate
1 1 1000 3499 4 01/01/2001 12/31/2001
2 1 3500 10000 5 01/01/2001 12/31/2001
3 2 1500 3399 4 01/01/2001 12/31/2001
4 2 3400 6999 5 01/01/2001 12/31/2001
5 3 500 1999 3 01/01/2001 12/31/2001
6 3 2000 4999 4 01/01/2001 12/31/2001
composite index will not here
Now when a new commission slab is inserted it should whether the same falls within the same period or not.

i was trying the following sql stmt, but it is not giving me required result

SELECT Desig, minamount, maxamount,startdate,enddate, 1 as A From commission Where 1000 >= minamount And 1000 <= maxamount and desig = 2 UNION
SELECT Desig, minamount, maxamount,startdate,enddate, 2 From commission Where 3000 >= minamount And 3000 <= maxamount and desig = 2
SELECT Desig, minamount, maxamount,startdate,enddate, 3 From commission WHERE #09/01/2003# >= startdate And #09/01/2003# <= enddate and Desig = 2
SELECT Desig, minamount, maxamount,startdate,enddate, 4 From commission WHERE #12/31/2003# >= startdate And #12/31/2003# <= enddate and desig= 2

can anyon plese help me in this.,

John Philip

Displaying A Form For A Set Period Of Time
Hello all, could anyone tell me how to go about displaying a particular form for only 5 seconds then make it dissapear? This should happen when a particualr button is pressed on a seperate form. Thanks.

Edited by - on 6/24/2004 3:11:49 AM

Time Interval Within The Date Period
I've spent few days seaching and finding out how to do this in vba but with no satisfying result.

F. ex.:
Date period: 25-09-2007 13:00 to 26-09-2007 23:00

time intervals: 06:00-15:00, 15:00-18:00, 18:00-03:00 and 03:00-06:00

I need to know total of hours for each time interval within the date period.

The result should be this:

06:00-15:00 = 11 h
15:00-18:00 = 6 h
18:00-03:00 = 14 h
03:00-06:00 = 3 h

Just to say that date period as well as start- and end times can vary in length.

I would very appreciate every help


VB Application Licensing For Trail Period
i have developed a VB application, which i need to provide to my customer for a trail period..

The details like "Installation Date", "No of Days" are Encrypted and stored in the registry and will be checking for the valid period by reading the registry

Once the user cross the Valid period, if the user changes the date also, Application will not work..

I wanted to know is there any mechanism apart from this and Writing the data to flat file to PROVIDE THE TRAIL PERIOD TO AN PACKAGE..

thanks in adv..


Closing File After Period Of Time
Is it possible to close a file after certain time frame passes? If yes how can it be done? Thx

Copyright © 2005-08, All rights reserved