CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Update automatically

Print topic Send  topic

Author Message
Fabrizio Vignozzi
Posted: 06/16/2002, 8:53 PM

I want update field DateLastAccess in table Users when single user log in.
i'm using asp with templates

tanks

Ken Hardwick
Posted: 06/17/2002, 2:23 AM

Fabrizio,
I wrote a function with a update SQL that I call when a user logs in.
I am keeping track of both the date of last login and the number of logins.


Add the following in On Login event of your login form...call the
function..
record_login(sLogin,bPassed)

Add the following in the global functions...you will need to modify
table/field names as you like...
My SQL is writen for oracle so you may need to modify it slightly also. Like
for instance if you are using
Access ...set default of count field to zero and remove the NVL function I
am using...


Function Record_Login(fPerson_ID,bPassed)
if bPassed > 0 then
sWhere = "PERSON_ID=" & ToSQL(fPERSON_ID, "Text")
sSQL = "update KMG_EPS_EMPLOYEE set " & _
"LOGIN_DATE = " & ToSQL(now, "Date") & _
",LOGIN_COUNT = NVL(LOGIN_COUNT,0) + 1 "
sSQL = sSQL & " where " & sWhere
cn.execute sSQL
end If
End Function

Anyway, hope this helps..
..Ken Hardwick,Norman,Ok



Fabrizio Vignozzi <fabrizio.vignozzi@amiconline.com> wrote in message
news:aejmf0$3t2$1@news.codecharge.com...
> I want update field DateLastAccess in table Users when single user log in.
> i'm using asp with templates
>
> tanks
>
>

Fabrizio Vignozzi
Posted: 06/17/2002, 11:57 AM

tanks for your help. i will try it.

I hope to help you in the future




"Ken Hardwick" <ken@kenhardwick.com> ha scritto nel messaggio
news:aek9r1$b4o$1@news.codecharge.com...
> Fabrizio,
> I wrote a function with a update SQL that I call when a user logs in.
> I am keeping track of both the date of last login and the number of
logins.
>
>
> Add the following in On Login event of your login form...call the
> function..
> record_login(sLogin,bPassed)
>
> Add the following in the global functions...you will need to modify
> table/field names as you like...
> My SQL is writen for oracle so you may need to modify it slightly also.
Like
> for instance if you are using
> Access ...set default of count field to zero and remove the NVL function I
> am using...
>
>
> Function Record_Login(fPerson_ID,bPassed)
> if bPassed > 0 then
> sWhere = "PERSON_ID=" & ToSQL(fPERSON_ID, "Text")
> sSQL = "update KMG_EPS_EMPLOYEE set " & _
> "LOGIN_DATE = " & ToSQL(now, "Date") & _
> ",LOGIN_COUNT = NVL(LOGIN_COUNT,0) + 1 "
> sSQL = sSQL & " where " & sWhere
> cn.execute sSQL
> end If
> End Function
>
> Anyway, hope this helps..
> .Ken Hardwick,Norman,Ok
>
>
>
> Fabrizio Vignozzi <fabrizio.vignozzi@amiconline.com> wrote in message
>news:aejmf0$3t2$1@news.codecharge.com...
> > I want update field DateLastAccess in table Users when single user log
in.
> > i'm using asp with templates
> >
> > tanks
> >
> >
>
>

Xavier
Posted: 06/20/2002, 1:11 AM

"Fabrizio Vignozzi" <fabrizio.vignozzi@amiconline.com> ha scritto nel
messaggionews:aelbec$ffn$1@news.codecharge.com...
> tanks for your help. i will try it.
>
> I hope to help you in the future

Sarà un pò difficile, Ken è uno della YesSoftware (almeno secondo gli
header).
Ciao.


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.