views:

36

answers:

1

Hi.

I am writing vb.net code to log a user into my application using SQL to authenticate the user. Each app user is an actual Microsoft SQL Server 2005 user. Now I need to test the login mechanism and for this I need to:

1) test against a SQL account that is locked.

2) test against a SQL account who's password has expired.

Is there some stored proc or SQL that I can run to manually lock out a SQL account and to update a SQL account so it's password has expired.

I do not want to wait for a day or 2 to get a SQL account who's password has expired.

+1  A: 

Just try and log in a few times with the wrong password. It will lock the login.

Expiry will have to wait until it, well, expires unfortunately.

Why not use Windows Authentication though?

gbn
My application uses Windows authentication by default, but some users need to explicitly log in with the SQL account. Locking the account is easy as you say, but the expiration of the password is a problem. I can wait if I have to, but would prefer to have some other way to expire a password to make the testing faster
Rouan van Dalen