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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to kick off linked users before maintenance 2

Status
Not open for further replies.

msshaw

Programmer
Feb 12, 2002
6
GB
Hi all,

I am looking for some code to clear users who have linked a table from a database - hence keeping the database locked whilst accessing this data.

Any ideas?

PS This is not quite the same as the
"VBA code to kick off logged users before maintenance"
thread.

Regards,

Mark
 
Your message is unclear. Are you saying any user can link to any database at any time and then you need to determine who is the user and lock/remove or what? Or are you saying users from external databases can link to tables in the database in focus and you want to be able to know who?

I strongly suspect that if you lock a table then external users can't make changes. Try it. Open a table in design mode, effectively locking the entire table, and have an external user try to change data in the table. Bet it's locked.

By the way. I know of no way to recognize that someone has linked into a table from an external database.


-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
a PART of such an effort would include using the built in Security to have users 'log on' the db. then ms. a. will maintain the .mdw file/db which will "Help".

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
I would do something even easier, if you don't use the security stuff (I don't even think the security stuff works in A97 but vould be wrong)

Anyway, why not have a table in the backend, that you set up and has a field that you set to true if you want to maintain. Then, the front end can do a dlookup for this value, andif set, can quit the database. The startup code for the front end should also poll this value, so people can't log in.

Of course you would need to add some nice code so that users aren't kicked off half way through a transaction etc..., but its not too hard to do (ie give one warning on first timer event, then boot on second, or display a non-modal dialog, that gives x seconds warning etc)
 
apkohn this is just plain bad advice and/or thinking. Regardless of the merit in your post, making the statement will cause many to disregard your advice as it clearly shows what you do not know.


(I don't even think the security stuff works in A97 but vould be wrong) MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Hi there, on another note, do any of you have the code for "VBA code to kick off logged users before maintenance"?

I've been searching for it and cannot seem to find it. Any help would be much appreciated.

Thanks.
 
The link below should take you there.

thread705-79802
 
MichaelRed,

Ok, let me rephrase that. I don't believe that you can use the Access 97 security to determine who is connected to a database.

In fact, quoting from <tt>In Access 97 and earlier versions, there's no built-in way to get a list of all users currently using your application. </tt>

The link for that is at
 
apkohn,

Look at the post. I &quot;quoted&quot; a VERY Specific STATEMENT from you.

However even the list of users statement is -at best- incomplete. The .lck file includes a reference to all users connected to an MS. A.

While there some issues with the content (including connections which are NOT currently active), there is at least a reference to all current connections, and MS. a &quot;White Paper&quot; Along with an unsupported DLL by Kevin Collins and Bob Delaval of Microsoft, detailing the (.lck) file information, which was included in &quot;ACCESS 97 Developer's Handbook&quot; Third Edition, Paul Litwin, Ken Getz, and Mike Gilbert from Sybex, ISBN 0-7821-1941-7, published (copyright date) 1997.

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Let me toss in my two cents worth on this issue. The original post stated 'users who have linked a table from a database'. This does not necessarily mean the the user referred to is logged in to the database which msshaw wants user information for. In this type case having a control table to keep track of users accessing the data would not work anyway because some type event would need to be fired when a user was operating in the database.

My second point is that security HAS and DOES work on Access 97, 2000, and 2002. Many rumors have circulated condemning it because it is not a simple task and MANY users do not have the knowledge necessary to properly implement it. That said, I believe any database implementing a user developed security system is highly suspect because there are just too many ways to circumvent it if you understand Access. Many developers who don't want to tackle Access User Security develop their own security systems and they tend to be those who do not have enough experience using Access to develop their own fault free systems.

I believe anyone who has a requirement for security and is a competent developer owes it to themselves and the system users to understand Access User Security before implementing their own security systems. They can then make informed decisions.

Some of my systems use Access User Security and I have learned a few lessons about maintaining these systems. Some of them the hard way by having a problem, some of them by studying the documentation, and some of them by experimentation (too often overlooked), and some of them by reading Tek-Tips and learning from developers like MichaelRed and others. I consider that I am an experienced Access developer who has a need to use Access User Security. I do not consider myself above learning from others on Tek-Tips. Seven years developing in Access in not enough time to learn all.

Thanks to all those who contributed to my learning process.

This is obviously more like ten cents worth.


-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top