Results 1 to 13 of 13
  1. #1
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Exclamation Unanswered: Finding users logged in to a session

    I have a program which will show you users logged into a session. It's designed in MS Access and will also record citrix/terminal users. If you would like a copy of the program, download the attachment or email me at paulk@weccusa.org.

    Paul Kohn
    Database Administrator
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    And?

    Code:
    USE Northwind
    GO
    
    CREATE TABLE spid_Sleep (
      SPID varchar(50)
    , Status varchar(50)
    , Login varchar(50)
    , HostName varchar(50)
    , BlkBy varchar(50)
    , DBName varchar(50)
    , Command varchar(50)
    , CPUTime varchar(50)
    , DiskIO varchar(50)
    , LastBatch varchar(50)
    , ProgramName varchar(50)
    , SPIDz  varchar(50)
    )
    GO
    
    INSERT INTO spid_Sleep EXEC sp_who2
    
    SELECT * FROM spid_Sleep WHERE Status = 'sleeping'
    GO
    
    DROP TABLE spid_Sleep
    GO
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    And and?
    Code:
    select	spid,
    	dbname = convert(varchar(20), db_name(dbid)),
    	login_time,
    	last_batch,
    	hostname,
    	nt_username,
    	loginame
    from	master..sysprocesses
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Where's the CPU..where's the diskIO? where's the status?
    Where's the tequila?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  5. #5
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565

    And Then

    AND THEN??????


    SP_Who2
    Attached Files Attached Files

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Again with the tequila?

    Code:
    select	case datename(weekday, getdate())
    	when 'Thursday' then 'Wait for it...wait for it...'
    	when 'Friday' then 'OK.  Go get the tequila.'
    	when 'Saturday' then 'One more for the road.'
    	when 'Sunday' then 'Give your liver a rest.'
    	else 'Show some self control for Pete''s sake'
    	end
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  7. #7
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    1 tequila, 2 tequila, 3 tequila, floor

    Gee I hope I didn't offend anyone...

    OK, now for the relevant conversation topic...

    Isn't there are forum for scripts or advertising?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  8. #8
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    you guys kill me

    with no reply, the initial post goes straight to the big bit bucket in the sky

    with such an entertaining followup, though, no moderator wants to remove such an entertaining thread...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  9. #9
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Users Logged in

    Wow! I didn't expect such interesting responses to the code. But seriously, does it help anyone? I just wanted to know because I have other pieces of code I use which I'll post if it's of any help. As an advant MSAccess user, I'd like people to know that MSAccess isn't just a poor man's programming language. I've seen a lot of crappy code out there in MSAccess and it's disappointing to see that people view MSAccess this way. We track several hundred thousand of records through MSAccess and SQL Server and I hate to see people disregard MSAccess because they think it's only for beginners and has no advanced logic to it. If anyone thinks otherwise, I'd like to know.

    Paul Kohn
    Database Administrator

  10. #10
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    First, Access is not a language. It's a tool. If you can write good VB and SQL you can write good VBA and SQL for Access, the Web etc.. Finally if you need to do anything other than data entry and reporting in a LAN environment with tables that do not have millions of records, Access is not the right tool.

    Other than it is OK.

    PS. data access pages suck and the report writer is a little inflexible.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  11. #11
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The biggest problem I see is that people have associated Jet with MS-Access so thoroughly that they can't seem to distinguish between them anymore.

    The Jet database engine was a great tool in its day, and it is still fine for single user applications with under 1 gigabyte of data. I'm not comfortable using Jet for multi-user applications for many reasons, although it can be done. I'm not disparaging Jet, I use it frequently, but not for "heavy lifting" type jobs.

    MS-Access is a great tool for building VBA applications. It provides a bunch of neat extensions that can make a developer's life a lot easier, but some of those extensions are two-edged swords... Much of the mind-set that drives MS-Access is the single user, small data set kind of thinking... If you follow that mind-set blindly, you can end up with applications that are practically impossible to scale up when necessary.

    -PatP

  12. #12
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Access is fine for small projects or single-user applications, but is not appropriate as an enterprise solution.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  13. #13
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    MS Access

    You are correct in that Access is a tool, not a language. Using Access as a front end with SQL Server as a backend makes a great combination even for those databases that are 1 gig or more in size. We have SQL Server databases in the Terrabyte sizes and write our code using unbound forms in Access (and yes they run extremely fast - even through citrix.)

    The development time in getting an application up and running (assuming that you know how to write good vba code (not macros!) and know how to use Access to it's full potential) makes it a great "tool"!

    I've used Access since version 1.0 and prefer it over any other "tool" (I used to be able to talk directly to the Access developers then.) Not to make an issue of it, but I've seen other tools die and the support for them become extinct. I've yet to see this with Access and have only seen more and more support each year.

    After converting hundreds of Access applications, I've still yet to see a program developed in Access which uses it to it's full potential. Most of the problems I've seen are those in which users simply don't know how to set up tables, indexes, and relationships correctly. Then they wonder why their code won't work correctly or things run too slow.

    Don't get me wrong. Access does have it's flaws and upgrading to newer versions can be a pain, especially if the code is written poorly or you're using ActiveX controls. But I would challenge anyone to get an application up and running faster using any other tool verses Access.

    If you're anti-microsoft, then you'll probably disagree with everything written here and have a bunch of reasons on why not to use Access. But let me know of an alternative solution and justification on why you wouldn't use such a great "tool", keeping in mind that EVERY tool has at least a few problems with it (If anyone knows of such a tool which doesn't have ANY problems which require workarounds, has the flexibility Access does, and can get an application developed extremely fast, I'd really like to know of it.) (Don't even bother answering if you're a Foxpro, Filemaker, Pascal, Fortran, or Delphi user.)

    Paul Kohn
    Database Administrator

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •