RE what user is accessing what table, this only works in the instant that the user is doing an operation on the table (that is, most of the time it'll return no rows (unless you happen to catch operations that are currently underway so that there are locks on the tables in question). But if someone's running a long process, you can see what table's being accessed (and watch for progress by repeatedly running it to see what page the lock(s) are on).
So that you can see the table name in question, run it from the DB whose table's are of interest.
use <your db goes here>
go
select p.spid, p.cmd, p.status, tbl_name = object_name (l.id), l.page
from master..sysprocesses p, master..syslocks l
where p.spid = l.spid
RE locking DB's and Tables
"Locking" a DB can be done by either putting it into "dbo use only", "single-user" mode or by putting it into "read-only" mode (as appropriate). All these are invoked via the sp_dboption command (see the Sys Admin Guide--for 12.5 it's in Chapter 22). The 12.5 version (I can't recall is 12.0 has this or not) also has a "quiesce database" which allows you to suspend updates (although it's discussed in the context of copying device files--for 12.5 this is in Chapter 26).
Hmmm. Locking tables is going to be a bit trickier unless all your users belong to a given group (e.g. public). Then you can do this:
revoke all on <table name> from <group name>
You could also, of course, just revoke UPDATE, DELETE, & INSERT permissions, for instance.
RE Locking a particular user, you need sp_locklogin (see the Sys Admin Guide's chapter on managing logins and users).
HTH,
John
J M Craig
Alpha-G Consulting, LLC
nsjmcraig@netscape.net