Couple things. I wouldn't name my variable strLoginName if it's a number field and not a name. Suggest you rename it to something like: intUserID, lngUserID, intLoginID, lngLoginID
Also, it's a bad practice to name your variable "name". "name" is a reserved keyword. Try to use sName or strName...