Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 132,257 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,193 people online right now. Registration is fast and FREE... Join Now!




capture time of login..

 
Reply to this topicStart new topic

capture time of login..

antukin_cs
post 25 Aug, 2008 - 09:36 PM
Post #1


New D.I.C Head

*
Joined: 6 Oct, 2007
Posts: 23


My Contributions


Adodc1.RecordSource = "SELECT * FROM USERS WHERE USERNAME ='" + txtUserName.Text + "'"
Adodc1.Refresh

If (Adodc1.Recordset.EOF = False) Then
If (txtPassword.Text = Adodc1.Recordset.Fields("Password")) Then
MsgBox ("Login Successful")
Else
MsgBox ("Login Failure. Incorrect Password")
End If
Else
MsgBox ("Login Failure. Username does not exist.")
End If



dats my code..can anybody help me add a code to capture the time a user logins...
User is offlineProfile CardPM

Go to the top of the page

vivekrane1986
post 25 Aug, 2008 - 09:58 PM
Post #2


New D.I.C Head

*
Joined: 1 Aug, 2008
Posts: 27


My Contributions


QUOTE(antukin_cs @ 25 Aug, 2008 - 10:36 PM) *

Adodc1.RecordSource = "SELECT * FROM USERS WHERE USERNAME ='" + txtUserName.Text + "'"
Adodc1.Refresh

If (Adodc1.Recordset.EOF = False) Then
If (txtPassword.Text = Adodc1.Recordset.Fields("Password")) Then
MsgBox ("Login Successful")
Else
MsgBox ("Login Failure. Incorrect Password")
End If
Else
MsgBox ("Login Failure. Username does not exist.")
End If



dats my code..can anybody help me add a code to capture the time a user logins...



Well If you just want to display the date and Time when user logs in You can Simply put

msgbox Now()

CODE


Adodc1.RecordSource = "SELECT * FROM USERS WHERE USERNAME ='" + txtUserName.Text + "'"
    Adodc1.Refresh

    If (Adodc1.Recordset.EOF = False) Then
        If (txtPassword.Text = Adodc1.Recordset.Fields("Password")) Then
            msgbox Now()
            MsgBox ("Login Successful")
        Else
            MsgBox ("Login Failure. Incorrect Password")
        End If
    Else
        MsgBox ("Login Failure. Username does not exist.")
    End If



Regards,
Vivs.
User is offlineProfile CardPM

Go to the top of the page

antukin_cs
post 26 Aug, 2008 - 07:37 PM
Post #3


New D.I.C Head

*
Joined: 6 Oct, 2007
Posts: 23


My Contributions


no i dont want to display the time, i want to save the time into the database (MS Access) and retrieve it later...how can i do it?
User is offlineProfile CardPM

Go to the top of the page

tope10
post 28 Aug, 2008 - 10:25 PM
Post #4


New D.I.C Head

*
Joined: 25 Jun, 2008
Posts: 22



Thanked 2 times
My Contributions


QUOTE(antukin_cs @ 26 Aug, 2008 - 08:37 PM) *

no i dont want to display the time, i want to save the time into the database (MS Access) and retrieve it later...how can i do it?

QUOTE


You can add a field in the tblUser, name it as TimeLog and after that, try to update the record in the database.


CODE

Adodc1.RecordSource = "SELECT * FROM USERS WHERE USERNAME ='" + txtUserName.Text + "'"
Adodc1.Refresh

If (Adodc1.Recordset.EOF = False) Then
If (txtPassword.Text = Adodc1.Recordset.Fields("Password")) Then

    Adodc1.Recordset.fields("TimeLog") = Format(Time, "HH:mm:ss am/pm")
    Adodc1.Recordset.Update
    MsgBox ("Login Successful")
Else
MsgBox ("Login Failure. Incorrect Password")
End If
Else
MsgBox ("Login Failure. Username does not exist.")
End If




User is offlineProfile CardPM

Go to the top of the page

thava
post 1 Sep, 2008 - 04:57 PM
Post #5


D.I.C Regular

Group Icon
Joined: 17 Apr, 2007
Posts: 424



Thanked 17 times

Dream Kudos: 50
My Contributions


i think check the lock type, and record set type also
because it would affect the update statement
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 10:57PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month