Re: Last Login

From: Simon (sruzgar_at_nospam.yahoo.com)
Date: 06/09/04


Date: Tue, 8 Jun 2004 21:19:18 -0400

Dale,

First up, thanks for your reply! The table "tblLastLogin" gets updated when
teh user logs out of the application on a page called "logout.asp" Im
defineltye trying to show the number of story submissions since the last tim
ethey logged in/out of the application, if you think there is a better way
to do this I'm all ears?

I addeed the following SQL statement:

    SELECT Count(Date) AS NewSubmissions
    FROM tblSubmission
    WHERE Date > (SELECT LastLogin FROM tblLastLogin WHERE UserName = '" &
strUser &"')"

then I populate the following variables:

    intLastLogin = rs.Fields("LastLogin")
    intCount = rs.Fields("NewSubmissions")

intCount gets successfully populated with the number of stories since last
login but intLastLogin does not get updated, any ideas why? Do I have to
update my SQL statement?

Thanks again (you rock)

Simon

"Dale Fye" <dale.fye@NoSpam.com> wrote in message
news:uAwI9ODTEHA.3580@TK2MSFTNGP09.phx.gbl...
> Simon,
>
> 1. My first question would be when does the LastLogin table have its
value
> entered? If it gets updated as soon as the publisher logs in, then there
> won't be any submissions that are newer than their login. What I think
you
> mean is you want to know the number of submissions between their previous
> login(or logout) and the current date/time. You might also want to
> reconsider just having the tblLastLogin in favor of maintaining a
tblLogins
> table with records all logins for a particular user. Much more
convenient,
> allows you to track usage by an individual rather than just their last
> usage, and is easy to query to get their previous login. However,
assuming
> what you want is what you originally asked for, the easiest method would
be
> something like:
>
> SELECT Count(S.SubmissionID) as NewSubmissions
> FROM tblSubmissions S
> WHERE S.SubmissionDateTime > (SELECT L.LastLoginDateTime FROM tblLastLogin
L
> WHERE L.LoginID = 999)
>
> HTH
> Dale
>
> Where you would substitute the correct loginId in the subquery. If your
> LoginID is text, you would have to wrap it in quotes.
>
>
> "Simon" <sruzgar@nospam.yahoo.com> wrote in message
> news:u7lent%23SEHA.504@TK2MSFTNGP11.phx.gbl...
> > hi folks,
> >
> > Im writing an ASP application where authors submit stories for use in a
> > book, everything is going pretty good so far however I have ran into a
> > stumbling block.
> >
> > the publishers of the book can log into an admin panel and
> view/edit/delete
> > stories, I'm trying to add functionality that shows them how mang
stories
> > have been submitted since they last logged into the site. I have the
> > following two tables:
> >
> > tblSubmission = holds the story submissions
> > tblLastLogin = holds username and last login date
> >
> > Both tables have a date field so how would I count the stories in
> > tblSubmission that are new since the last login date in tblLastLogin?
> >
> > Thanks in anticipation
> > Simon Ruzgar
> >
> >
>
>



Relevant Pages

  • Re: Last Login
    ... If it gets updated as soon as the publisher logs in, ... won't be any submissions that are newer than their login. ... WHERE S.SubmissionDateTime> (SELECT L.LastLoginDateTime FROM tblLastLogin L ... > stories, I'm trying to add functionality that shows them how mang stories ...
    (microsoft.public.access.queries)
  • Last Login
    ... stories, I'm trying to add functionality that shows them how mang stories ... tblSubmission that are new since the last login date in tblLastLogin? ...
    (microsoft.public.access.queries)
  • Re: Auto Populating Blocked IPs List
    ... I just checked my security logs - which I save - and I see ... The earlies attacks were trying to almost invariably login as ... >IP blocks their ISP is handing out and allow only those. ... Bill Vermillion - bv @ wjv. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: Account Lockout Policies
    ... Allowing accounts to remain dormat for 30 days ... If a technical solution is unavoidable due to a lack of management buy-in, ... Extract login details from the security logs. ...
    (microsoft.public.security)
  • RE: Failed admin logins
    ... Understanding that my suggestion may not always be possible - pull the plug and ... communicating with that box with the logs of when the login occurs. ... > I have a machine that is trying to log in as the domain administrator ...
    (Security-Basics)