CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Last Login---based on submission by Ken Hardwick

Print topic Send  topic

Author Message
Chris
Posted: 03/05/2002, 12:05 PM

Chris
Posted: 03/05/2002, 12:06 PM

Hi Ken,
Thanks for this code... I had to make a few changes because my USERS table is called MEMBERS but otherwise everything is the same. I placed it in the ON LOGIN event part of the login FORM (of the login page)... the code is working because it changing my database, but I"m getting the following error (any ideas???):

update MEMBERS set last_login_date = now , login_count = login_count + 1 where member_login= 'admin'
Response object error 'ASP 0156 : 80004005'

Header Error

/portal/Login.asp, line 155

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
me again
Posted: 03/05/2002, 12:50 PM

Add the code below to your After-Login Event
Table = Users
Field for Login ID = Login
Field for login date = Login_Date
Also, added count field to keep track of times logged in
Login_Count

This executes only if login/password are valid..if bpassed= 0

The sLogin is temporary variable of loginid entered.

'***********************************************************************

if bPassed > 0 then
sWhere = "Login= " & toSQL(sLogin,"Text")
sSQL = "update USERS set " & _
"LOGIN_DATE = now " & _
",LOGIN_COUNT = LOGIN_COUNT + 1 "
sSQL = sSQL & " where " & sWhere
response.write sSQL
cn.execute sSQL
end if
Ken Hardwick
Posted: 03/05/2002, 1:57 PM

Your "Header error" message is due to the "Response.write sSQL" statement.
I had had that in there as I was developing my code..it should be taken out.

if bPassed > 0 then
sWhere = "Login= " & toSQL(sLogin,"Text")
sSQL = "update USERS set " & _
"LOGIN_DATE = now " & _
",LOGIN_COUNT = LOGIN_COUNT + 1 "
sSQL = sSQL & " where " & sWhere
'***********************************response.write sSQL
cn.execute sSQL
end if

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.