Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: mk sharma
  Where is mk sharma?
 mumbai
 India
 mk sharma
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 Tags
Subject: RE: how to stop user from Re-Login
Thread ID: 330907 Message ID: 331062 # Views: 35 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Projects and Design
Date: Monday, December 26, 2011 12:02:01 PM         
   


> > How we can stop a user from Login again and again ?
> >
> > On PC-1 user "ADMIN" is logged in, but how to stop user "ADMIN" to login to PC-2 ?
> >
> >
> > Close All
> > Clear All
> > Set Multilocks On
> > Set Reprocess To -1
> > Set Exclusive Off
> > Use USERF
> > Set Order To USERNAME
> > Seek 'ABC '
> > If IsRLocked()
> >    Wait Window 'Already Logged in '
> > Else
> >    Wait Window 'Login Success'
> >    Rlock()
> > Endif
> > 

> >
> > on PC-2, always Showing "Attempting lock..."
> >
> > Warm Regards,
> > mk.
>
>
>
> As Vivek said, the Set Reprocess is wrong, better try something like
SET REPROCESS TO 1 SECONDS

> In addition, you do not want to check isRLocked() because it is a "local" thing, but rather evaluate the returned values of your (Seek() line and) the RLock() line: the latter should return .T. for success in the first instance and .F. as expected in the second instance (and subsequent).
> You can test the approach by opening two IDE sessions on the same dev PC
>
>
>
> hth
> -Stefan

i have changed my code as below :

Close All
Clear All
Set Multilocks On
Set Reprocess TO 3    && for 3 seconds
Set Exclusive Off
Use USERF
Set Order To USERNAME
Seek lcusername
If RLOCK()
   Wait Window 'Login Success'
Else
   Wait Window 'Someone Already Logged in '
Endif


Warm Regards,
mk.

ENTIRE THREAD

how to stop user from Re-Login Posted by mk sharma @ 12/24/2011 11:22:10 AM
RE: how to stop user from Re-Login Posted by Vivek Deodhar @ 12/24/2011 12:20:24 PM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/24/2011 12:31:54 PM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/26/2011 3:27:48 AM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/26/2011 7:13:14 AM
RE: how to stop user from Re-Login Posted by Stefan Wuebbe @ 12/26/2011 10:43:52 AM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/26/2011 12:04:10 PM
RE: how to stop user from Re-Login Posted by Anil Sharma @ 12/26/2011 12:09:51 PM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/26/2011 12:23:46 PM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 5:56:27 AM
RE: how to stop user from Re-Login Posted by Anil Sharma @ 12/27/2011 8:40:33 AM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 11:30:17 PM
RE: how to stop user from Re-Login Posted by Stefan Wuebbe @ 12/26/2011 6:29:48 PM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 5:34:38 AM
RE: how to stop user from Re-Login Posted by Stefan Wuebbe @ 12/27/2011 10:10:50 AM
RE: how to stop user from Re-Login Posted by Vivek Deodhar @ 12/27/2011 10:37:58 AM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 11:27:56 PM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 11:19:20 PM
RE: how to stop user from Re-Login Posted by anand kulkarni @ 12/26/2011 3:57:11 AM
RE: how to stop user from Re-Login Posted by Stefan Wuebbe @ 12/26/2011 10:38:35 AM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/26/2011 12:02:01 PM