Link to home
Create AccountLog in
Avatar of gcook17
gcook17Flag for United States of America

asked on

VB.Net 2005 Cannot Login With SQLAuthentication

I have a VB.net windows forms application that is a front-end to a SQL Server databse. Using ado.net 2.0 I am able to login to the database with Windows Authentication no problem. However, when attempting to use SQL Authentication the log in fails with the following message: "Login failed for user 'dan'. The user is not associated with a trusted SQL Server connection"
Here is the connection string being used for SQL Authentication (fails): "Provider=SQLOLEDB;Server=SERVER2006\SQLEXPRESS;Database=TestDB;Uid=dan; Pwd=1111"  I must be able to use SQL Authentication for security reasons. Please help with this problem. Thank you.

BTW:Here is the database connectioon string that works in Windows Authentication (succeeds): "Provider=SQLOLEDB;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=TestDB;Data Source=SERVER2006\SQLEXPRESS"
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of gcook17

ASKER

Thanks
Avatar of gcook17

ASKER

One more comment. The above connection string actually should say "User ID" (instead of Uid) and "Password" (instead of Pwd). I believ this does make a difference.

"ADOConnectionString" value="Provider=SQLOLEDB;Persist Security Info=False;Initial Catalog=Database;Data Source=SERVER2006\SQLEXPRESS;User ID=dan;Password=1111"