Bob A
|
Posted: 01/08/2004, 5:07 PM |
|
Hello
I have been working in this problem for a little while now. All I want to do
is after the login event takes place a field in my database updates current
date. I'm doing this in ASP
Connection = tddata (MSAccess database)
Table name = Addressbook
Emp_ID = UserID
Last_Name = Login Field
Last_Login = is what I want to update
I've seen aquite a few examples on this but have not been able to get it to
work.
I have Code Charge Studio2
Any help would be appreciated
|
|
|
Edd
Posts: 547
|
Posted: 01/08/2004, 2:57 PM |
|
Bob,
Look at the events code.
To login it fires the "Login_Button_DoLogin_OnClick()" event.
When it completes the event call a function to perform the update through SQL.
e.g.
function updateDate(aUserID)
Dim DBConn
Set DBConn = new clsDBtddata
DBCOnn.Open
DBConn.Execute "update addressbook set last_login=" & DBConn.ToSQL(ccsDate, Date) & " where EmpID =" & Cstr(EmpID)
DBConn.Close
Set DBConn = nothing
End Function
_________________
Accepting and instigating change are life's challenges.
http://www.syntech.com.au |
|
|
Bob A
|
Posted: 01/09/2004, 10:50 AM |
|
Thanks for the quick reply.
I placed the code you gave me as such. (see below) Now I'm not exactly sure
how to call the function
HELP!!!!
Function Login_Button_DoLogin_OnClick() 'Login_Button_DoLogin_OnClick
@4-ADB4691A
'Login @5-AA430BB1
With Login
If NOT CCLoginUser(.login.Value, .password.Value) Then
.Errors.addError("Login or Password is incorrect.")
Login_Button_DoLogin_OnClick = False
.password.Value = ""
Else
If Not IsEmpty(CCGetParam("ret_link", Empty)) Then _
Redirect = CCGetParam("ret_link", Empty)
Login_Button_DoLogin_OnClick = True
End If
End With
'End Login
'Login @5-AA430BB1
With Login
If NOT CCLoginUser(.login.Value, .password.Value) Then
.Errors.addError("Login or Password is incorrect.")
Login_Button_DoLogin_OnClick = False
.password.Value = ""
Else
If Not IsEmpty(CCGetParam("ret_link", Empty)) Then _
Redirect = CCGetParam("ret_link", Empty)
Login_Button_DoLogin_OnClick = True
End If
End With
End Function 'Close Login_Button_DoLogin_OnClick @4-54C34B28
function updateDate(aUserID)
Dim DBConn
Set DBConn = new clsDBtddata
DBCOnn.Open
DBConn.Execute "update addressbook set last_login=" & DBConn.ToSQL(ccsDate,
Date) & " where Emp_ID =" & Cstr(Emp_ID)
DBConn.Close
Set DBConn = nothing
End Function
"Edd" <Edd@forum.codecharge> wrote in message
news:63ffde04d11201@news.codecharge.com...
> Bob,
> Look at the events code.
> To login it fires the "Login_Button_DoLogin_OnClick()" event.
>
> When it completes the event call a function to perform the update through
SQL.
>
> e.g.
> function updateDate(aUserID)
> Dim DBConn
>
> Set DBConn = new clsDBtddata
> DBCOnn.Open
> DBConn.Execute "update addressbook set last_login=" &
DBConn.ToSQL(ccsDate, Date) & " where EmpID =" & Cstr(EmpID)
> DBConn.Close
> Set DBConn = nothing
> End Function
>
>
> _________________
> a simple idea....
> www.syntech.com.au
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
Bob A
|
Posted: 01/13/2004, 6:34 AM |
|
Thanks for the quick reply.
I placed the code you gave me as such. (see below) Now I'm not exactly sure
how to call the function
HELP!!!!
Function Login_Button_DoLogin_OnClick() 'Login_Button_DoLogin_OnClick
@4-ADB4691A
'Login @5-AA430BB1
With Login
If NOT CCLoginUser(.login.Value, .password.Value) Then
.Errors.addError("Login or Password is incorrect.")
Login_Button_DoLogin_OnClick = False
.password.Value = ""
Else
If Not IsEmpty(CCGetParam("ret_link", Empty)) Then _
Redirect = CCGetParam("ret_link", Empty)
Login_Button_DoLogin_OnClick = True
End If
End With
'End Login
'Login @5-AA430BB1
With Login
If NOT CCLoginUser(.login.Value, .password.Value) Then
.Errors.addError("Login or Password is incorrect.")
Login_Button_DoLogin_OnClick = False
.password.Value = ""
Else
If Not IsEmpty(CCGetParam("ret_link", Empty)) Then _
Redirect = CCGetParam("ret_link", Empty)
Login_Button_DoLogin_OnClick = True
End If
End With
End Function 'Close Login_Button_DoLogin_OnClick @4-54C34B28
function updateDate(aUserID)
Dim DBConn
Set DBConn = new clsDBtddata
DBCOnn.Open
DBConn.Execute "update addressbook set last_login=" & DBConn.ToSQL(ccsDate,
Date) & " where Emp_ID =" & Cstr(Emp_ID)
DBConn.Close
Set DBConn = nothing
End Function
"Edd" <Edd@forum.codecharge> wrote in message
news:63ffde04d11201@news.codecharge.com...
> Bob,
> Look at the events code.
> To login it fires the "Login_Button_DoLogin_OnClick()" event.
>
> When it completes the event call a function to perform the update through
SQL.
>
> e.g.
> function updateDate(aUserID)
> Dim DBConn
>
> Set DBConn = new clsDBtddata
> DBCOnn.Open
> DBConn.Execute "update addressbook set last_login=" &
DBConn.ToSQL(ccsDate, Date) & " where EmpID =" & Cstr(EmpID)
> DBConn.Close
> Set DBConn = nothing
> End Function
|
|
|
|