Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sign-on Logging (Best Practices) (VB6)

    I have a couple apps I built in VB6 for which I created a log file recording log-in's and log-out's and the times they occurred for each user. The problem I'm running into is that it works fine when the user gracefully logs out. I also had a routine in my UI that allows administrators to see who is logged into the system currently. This part is simple, it looks for any entry that has a log-in time recorded and the log-out time is null.

    Interestingly, we seem to have a lot of users that don't log out gracefully for whatever reason. Has anyone else delt with this issue? It's almost as if I would have to have another application running in the background that keeps handshaking somehow with the client to determine if anyone is still home.

    I'm interested if anyone else has done anything like this and how the problem was resolved when the user doesn't shut down by normal means.

  2. #2
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sign-on Logging (Best Practices) (VB6)

    How can a use *not* log out gracefully? <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

    Do you mean your app dies before they can correctly log out? Assuming your code that writes the log-out time stamp is this same app, it wouldn't be able to do that action if it didn't end gracefully. I assume you have that code in some 'close' or 'shutdown' type of event where you do clean up before shutting down.

    I'm sure this isn't news to you, but I'm not clear on the other ways a user can exit your program correctly (w/o a crash) and not cause your logging code to get run. Since you said there are quite a few users doing this, then if you know how they're exiting, you might be able to prevent them from doing that action. (Or better yet determine why your code isn't detecting a shut down.)

    Deb <img src=/S/doh.gif border=0 alt=doh width=15 height=15>

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sign-on Logging (Best Practices) (VB6)

    This is something I didn't think I would have to deal with, actually, until it went into production. You are correct, I have it in the Form Terminate Event.

    There is a large user population, some have really poor computers that will hang (not just my app) and they do a control alt delete and end task to bail out of it. We upgraded the pc's of several users and I don't think this is an issue so much. The real problem is that we are running the program off a Citrix server which has a timeout interval set. This will log the user out of Citrix after no activity is received in a few minutes. This also terminates any open applications.

  4. #4
    Star Lounger
    Join Date
    Nov 2001
    Location
    Illinois, USA
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sign-on Logging (Best Practices) (VB6)

    Mike, Have you tried putting the logout code in the QueryUnload event? That event will run even if the App is closing because of Windows shutting down, so maybe it will run if the reason for closing is a Citrix timeout.

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sign-on Logging (Best Practices) (VB6)

    HI there Dottie

    You know what, I've seen that event but never paid attention to it I guess because I've never knew what it did. You're saying that if Citrix is shutting down an application, or if if someone shuts down an application using the End Task in Windows, this event will still fire?

  6. #6
    Star Lounger
    Join Date
    Nov 2001
    Location
    Illinois, USA
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sign-on Logging (Best Practices) (VB6)

    Hi Mike,
    Yes, that is the way QueryUnload is supposed to work. It has an UnloadMode parameter that you can check to see why the whether the form is about to be unloaded: due to code, the user clicking the X (control box), Windows shutting down, or the Task Manager End Task. You can set the Cancel parameter to True to prevent unloading if the mode is not the graceful exit you want. I'm just not sure if Citrix shutting the application down on a timeout will be treated the same way as End Task or Windows shutdown.

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sign-on Logging (Best Practices) (VB6)

    It is certainly worth a try, Thanks Dottie. I'll let you know what I find.

  8. #8
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sign-on Logging (Best Practices) (VB6)

    Dottie, I wanted to get back to you on this (an for anyone else that is interested). This worked great, and it executes even during a Citrix timeout.

    Thanks again for your help.

  9. #9
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sign-on Logging (Best Practices) (VB6)

    I just wanted to update this thread, correcting that the termination code in the QueryUnload event does not fire during a Citrix time out. I tried it initially and I thought it worked. I don't know what I must have been looking at. Anyhow, this technique will come in handy on any future non-Citrix apps that I develop.

Posting Permissions

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