Yes you can do it. Make a table in database and store the username and corresponding password.
When needed, verify against it and get back the needed data.
Example:
EmployeeID Username Password
1 someuname somepassword
Actually, you should encrypt the password and then keep it in DB. (out here I have written in clear text for sample)