|
-
Mar 13th, 2004, 04:44 AM
#1
Thread Starter
Fanatic Member
database-storing time and date
i have a database created with the following fields:
Username
Time and date
I have a form, when the correct password is entered, i would like for the username (which was selected on the form) to be stored along with the current system time and date.
The database as it stands is empty and any information should be updated to the database.
How is it possible to do this?
thanx in advance.
-
Mar 13th, 2004, 12:08 PM
#2
Frenzied Member
It is definitely possible. What's your database? I work pretty much exclusively with MSSQL 2000, so if you use that, I can help you out - I have code somewhere that does exactly that.
Mike
-
Mar 13th, 2004, 03:33 PM
#3
Fanatic Member
firstly i would give the database a seperate table for this something like, UTB_UserLogins (UTB= User Table ) if using sql its nicer to group the tables together.
contained within the table i would have.
RecordId int increment of 1
FK_UserId int > This would be a relation to the user table (fk = foreign key)
LoginTime smallDateTime
LogoutTime smallDateTime
If your user closes the main form you can fire an event to store when they log out as well
all you need to do its save the time to get the date and time just use date.today.now()
If your in england and using SQL db in usa format then your need to change the date format by using something like format(date.today.now,"dd/MM/yyyy") I Think i wrote a class to handle dates so i dont need to worry tomuch anymore
Well good luck
Last edited by carlblanchard; Mar 13th, 2004 at 03:37 PM.
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
-
Mar 13th, 2004, 08:48 PM
#4
Frenzied Member
This is a question that would probably be better asked in the database forum.
but, look into using ado or ado.net to connect to your database and then you'll have to know a bit of sql to stick data into the appropriate tables on the database. Pretty easy actually..once you do it a few times.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|