Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to lock recordset in a multi-user environment 2

Status
Not open for further replies.

sonper

Programmer
Oct 4, 2001
94
0
0
PH
Hi fellas! Does anyone here have an idea of how am I going to lock a recordset (one record) in a multi-user environment? I'm trying to create a login module wherein once a user has successfully logged-in on one workstation using a UserID, he can no longer use the same UserID in another workstation. Also, when a record in open on a certain workstation, it should not be accessible to another workstation.

I'm using VB6 and MS Access.

Please help!
 
Peter / Martin,

Yes, you do need to consider the situation where Comp A is no longer available. Hopefully this is not vary likely and so it is probably OK for a techie to update the database using Access in this situation rather than having an admin screen.
 
Ah, the sweet song of the voice of reason...

Is the one login only requirement really a requirement, or is it something you can live without Sonper?
 
An option that might work would be to register a sort of 'heartbeat'. It would require alot of overhead but... just brainstorming.
Your client machine could update a field in the login table with the current time. The client programs could be instructed to update the field every 30 seconds or minute or whatever. When another client tries to log in using the same username, it could check the last heartbeat time. If the time is older than the update period, it could be assumed that the last login is stale. A problem would be synchronising the clocks on all of the client machines.. unless there's a way to use the clock of the machine housing the db.
 
Sorry guys but it seems to me that the solutions are getting more and more complicated and honestly I cannot no longer relate to what you've been discussing.

mmilan,

Correct me if I'm wrong. I think it's a standard thing that no 2 persons can log on a system at the same time.

Thanks anyway guys. I really appreciate your concern.
 
If no 2 people could be logged in at the same time, it wouldn't be a multiuser system! I assume therefore your last message is a typo...

In general, I would have to say that most of the systems I have played with have not restricted access to one connection per user (which is essentially what you're talking about). That being said, I can think of good reasons why they should restrict, and equally good ones not to.

If you have the option therefore, I'd be tempted to drop the restrictions from your code and save yourself a headache.

mmilan
 
mmilan,

I stand corrected. It's not what I'm trying to point out. I really don't find it convincing to allow the same user (U-001) to log in at the same time on two workstations. I'm not sure about this but the application that I've been working on requires monitoring of users log and each users have different tasks to do. Furthermore, the application involves processing of permits which I think accountability of users is important. Anyway, thanks again for your concern.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top