March 28, 2007 at 3:18 am
I have a script which creates a new user. I also have a webpage which uses the DB for various reasons. In the DB config file I use the following to connect to the DB;
<ConnectionString>User Id=<username>;Password=<pword>; DataBase=<DBname>; Server = <servername>;</ConnectionString>
For the username and password I use the newly created user information but I can’t connect. However if I use “sa” to login I have no problem. Is this a case of some crappy SQL prerequisites?? i.e. automatically checking “Enforce password expiration” or “user must change password at next login” in the user properties. If I change the password for the new user in properties I can connect no problem.
Is there a way around this, so I don’t have to change the password before I can connect to the DB?
Thanks in advance
Regards
Toby
March 28, 2007 at 4:22 am
The script I am using is as follows;
if not exists (select * from dbo.sysusers where name = N'User' and uid < 16382)
EXEC sp_grantdbaccess N'User', N'User'
GO
April 10, 2007 at 8:01 am
By creating a new sql login the Enforce password expiration” or “user must change password at next login” properties are checked.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply