Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi

I have a SQL server DB (SQL Server 2008 R2) that I use with my classic asp web app.

I recently created a login and user with matching credentials using SQL Server Management studio. I amended the login details to my connection string. I can no longer connect to the database.

Please assist, I am still learning in this field

My initial string: " Provider = SQLOLEDB; data source=(local);Integrated Security=SSPI; Initial Catalog= myDBName; Trusted_Connection=Yes"

New string: " Provider = SQLOLEDB; data source=(local); Database= JointsDB; Uid= myUser; Pwd= myPassword"
Posted

What did you set the server authentication to?
The two options are Windows Authentication Mode or SQL Server and Windows Authentication Mode.
You most likely need to change the authentication mode to the second one.
To do this open Management Studio and connect to your SQL Server.
Once connected right click the top server node and then select properties.
In the popup on the left hand side select the Security page.
On the security page the top option is the one you want to change to allow SQL Logins(connection string with username and password) and Windows logins(trusted connection strings).
 
Share this answer
 
Hi,

you don't seem to be creating your connection string properly.

Have a look here.

Something like this should be better:
C#
"Provider=SQLOLEDB;data source=(local);User id=myUser;Password=myPassword;Initial Catalog=JointsDB"


Hope it helps.
 
Share this answer
 
v2
Comments
Member 8654266 29-Aug-14 5:05am    
I have not had a chance to try your suggestions but I feel positive about them.
I will let you know how it goes.

Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900