4 Replies - 3327 Views - Last Post: 01 September 2008 - 05:57 PM Rate Topic: -----

#1 antukin_cs  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 06-October 07

capture time of login..

Post icon  Posted 25 August 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...

Is This A Good Question/Topic? 0
  • +

Replies To: capture time of login..

#2 vivekrane1986  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 102
  • Joined: 02-August 08

Re: capture time of login..

Posted 25 August 2008 - 10:58 PM

View Postantukin_cs, on 25 Aug, 2008 - 10:36 PM, said:

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()


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.
Was This Post Helpful? 0
  • +
  • -

#3 antukin_cs  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 06-October 07

Re: capture time of login..

Posted 26 August 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?
Was This Post Helpful? 0
  • +
  • -

#4 tope10  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 23
  • Joined: 26-June 08

Re: capture time of login..

Posted 28 August 2008 - 11:25 PM

View Postantukin_cs, on 26 Aug, 2008 - 08:37 PM, said:

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.


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




Was This Post Helpful? 0
  • +
  • -

#5 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: capture time of login..

Posted 01 September 2008 - 05:57 PM

i think check the lock type, and record set type also
because it would affect the update statement
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1