Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB login to SQL Server 3

Status
Not open for further replies.

ScottAW

Programmer
Apr 9, 2001
25
US
I have a custom login form in my VB app. The user types in their username and password which I then include in my ADO connection string to my SQL Server. The problem is, it will only recognise SQLServer security accounts. Any login that is set up as an NT User, it will not recognise and validate. What's the problem?? Do I need some extra link or modification in my connection string for it to validate NTUser names and passwords??
 
This rings a big bell. I have, or appear to have, exactly the same thing at a customer's site. It's an Access programme using this as a connection string
ConnectString=ODBC;DRIVER=SQL Server;UID=sa;PWD=;DATABASE=CorbyChilled2;SERVER=CorbyChilled_SQL;Trusted_Connection=Yes;

and they always get a sql login box too. Apparently the ppl who installed the hugely expensive compaq kit are having a (expensive) think about it. I'll let you know the outcome. Peter Meachem
peter@accuflight.com
 
I think SQL server can only be configured to accept SQL accounts or NT UserName. I would just add the NT accounts to the SQL server. I'm new at this though!! Every day above ground is a GOOD DAY!!!
 
No, SQLServer can accept both NT and SQL security accounts (Mixed Security Mode). This is on SQL7. You can assign user names to the database which can be different from the login name (the login for an NT account is Domain\LoginName, but in each database, you can give it an aliased UserName).
 
Try this if nothing else works
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SomeDB;Data Source=SomeServer

The Integrated Security part is what you need I think. I created this by slapping an ado control onto a blank form and then generating a connection string by following the directions. It creates what I put above. Hope this helps.
 
AaronA -- That was it. Thank you very much. That question has loomed for a while and have not had a chance to figure it out. Thanks for saving me the time!!!!
 
Thanks, I'll get my customer to try this too. Peter Meachem
peter@accuflight.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top