Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple ASP Database Record Add

Status
Not open for further replies.

LizardKingSchwing

Programmer
Oct 12, 2001
96
0
0
NL
Hi

This is fairly basic but I have an ASP page which reads from a DB Table called users. Then I check /
verify users name/password and let thenm continue if verified ok. However I need to log user login time
so I have another table called logs which I want to add a record with date/time of login and user who
logs in.

How do I do this in ASP

Cheers

LK--<
 
lizardkingschwing,

Why not just create a column called &quot;LastLogin&quot;?

fengshui_1998
 
I need to keep a login history of user logins so I can keep track of all logins
 
when you validate the user and extract the record from the user table set a variable to the username, id etc.. and then insert that info + the date into you log table
Code:
INSERT INTO Log_table ( Field_User, Field_date) VALUES ('&quot; & strUser & &quot;', '&quot; & strDate & &quot;')
 
Thanks thats great so now I have log working but I have a new problem with date format. The dat is stored in the log table as Month/Day/Year Time but I want to store as Day/Month/Year Time

any ideas ??

LK--<
 
Setting session.LCID let's you define which locale you are using...
But much simpler would be to make now() the default value of your date field and let the db sort it out for you...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top