Technical Support, Instructions & Repair Service

Microsoft Internet PS/2 Keyboard - OEM

How to control the number of users running the...

By pandamama - usenet poster


Hi Friends

How to limit the number of user running a program design using vfp??

For a one user control, what I did was using a counter to record the number
of time a program run in a dbf file. If the user number is ONE, the lncounter
= 1 and so if run another time, the lncounter = 2 and since the number of
user allowed was ONE, the program will display a message "Please run the
program one at a time".

Well, it works just fine until yesterday the computer "hang" for whatever
reasons ... when I re-run the program, the display message "Please run the
program one at a time" appear. Appearantly, the lncounter that was in the dbf
was not reset to zero.

I have to access the dbf file, reset the counter to Zero before running the
program again. Since I have already complied the program, my user will not
know how to solve this problem.  

Any ideas how to resolve this problem??

Tks

--
Ignatiuus Ong
I have the same problem
This Problem has been added to the Share Your Expertise Page under "My Work Queue".

Solution #1

posted on Aug 09, 2005
Not Rated (0)

Janice

Rank:Apprentice Apprentice
Rating: 0%, 0 votes
Hi Craig Berntson

I tried the program. It works with some modification.

1. IF FOPEN(???F:\MyApp\??? + TextFile)
- under VFP6, the return type is numeric and not logic.
Thus unable to FOPEN this program line.

What I did was:
     abc = FOPEN(???F:\MyApp\??? + TextFile)
     if abc != -1
          wait window ???open file??? timeout 1
     else
          wait window ???cannot open file??? timeout 1
     endif

One little problem I found out was that when the maximum number of users is
more than one or two. If the same user logs in using the same id and password
multiple times, the program is unable to detect the multi-entry by same user.
Since my program will be sold to Small, Medium Enterprise (SME), it is highly
probable that the buyer may log in using same id for all work-stations. Just
a precaution, any ways to prevent such incidents?

Thank you vm

Sincerely

Ignatiuus Ong
Was this solution helpful? Show your Appreciation by rating it:

Thank You!

Was the solution helpful?
Show your appreciation by commenting on How to control the number of users running the software?:


I don't want to Accept this solution

Solution #2

posted on Aug 09, 2005
Not Rated (0)

Peter1

Rank:Apprentice Apprentice
Rating: 0%, 0 votes
See http://www.craigberntson.com/A rticles/kb003.htm

--
Craig Berntson
MCSD, Visual FoxPro MVP
www.craigberntson.com
Salt Lake City Fox User Group
www.slcfox.org
www.foxcentral.net
Was this solution helpful? Show your Appreciation by rating it:

Thank You!

Was the solution helpful?
Show your appreciation by commenting on How to control the number of users running the software?:


I don't want to Accept this solution

Solution #3

posted on Aug 09, 2005
Not Rated (0)

Jimmy NY

Rank:Apprentice Apprentice
Rating: 0%, 0 votes
Hi Craig Berntson

Thank you. Will try this program.
Have a nice day.

Sincerely

Ignatiuus Ong
Was this solution helpful? Show your Appreciation by rating it:

Thank You!

Was the solution helpful?
Show your appreciation by commenting on How to control the number of users running the software?:


I don't want to Accept this solution

Solution #4

posted on Aug 09, 2005
Not Rated (0)

herself

Rank:Apprentice Apprentice
Rating: 0%, 0 votes
Ignatiuus,
Rather than using a counter field, it better to use a FLOCK(). This allows you
to check to see if the record is locked, then it's in  use, otherwise it will be
locked. If you need to support multiple users, just add the number of records
you want as the maximum at a time and search for any unlocked record. The big
advantage is that if the program crashes or the connection is lost for some
other reason, then the server will automatically unlock the record and the
record will be available to another login attempt.

Rick
Was this solution helpful? Show your Appreciation by rating it:

Thank You!

Was the solution helpful?
Show your appreciation by commenting on How to control the number of users running the software?:


I don't want to Accept this solution

Solution #5

posted on Aug 09, 2005
Not Rated (0)

Beresford

Rank:Apprentice Apprentice
Rating: 0%, 0 votes
Hi Rick

Tks vm. Will follow your suggestion.
I am new to vpf, so can you provide a short program how I can go about
FLOCK() a file userlist.dbf for 3 users?

Have a nice day.

Sincerely

Ignatiuus Ong
Was this solution helpful? Show your Appreciation by rating it:

Thank You!

Was the solution helpful?
Show your appreciation by commenting on How to control the number of users running the software?:


I don't want to Accept this solution

Can you Help with these Keyboards and Mice problems?

Keyboards and Mice
I already install the driver but nothing happens I...

Keyboards and Mice
I have a mi micro innovations wireless keyboard and mouse....

Keyboards and Mice
anything from desktop. Have access only to start and...

Microsoft Internet PS/2 Keyboard - OEM...
the spacebar metal hinge things doesnt wanna work its...

Microsoft Internet PS/2 Keyboard - OEM...
The commercial at symbol does not work as it should when...

Loading problems.

Repair Service

Find Keyboard and Mice Repair Service Provider Near You:
Browse the Repair Service Directory
Repair Service Providers, Get Listed FREE

Prescreened Contractors

Get Matched to Prescreened Computer Professionals

Category
Zip code

When the original poster rates a solution that was given to his own problem, that rating is locked!
X

Are you sure the solution content is Inappropriate?
   
Tech buddies can communicate directly to answer questions. Become a Tech Buddy and have direct access to your favorite expert for FREE!