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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sql sever authentication

Status
Not open for further replies.

rdharmar

IS-IT--Management
Jun 20, 2001
54
US
I have always used NT authentication (trusted connection) to logon to SQL server but now I'm forced to use the SQL Server's native security. I've created a DSN to make a connection to the SQL Server database but can anyone help me build the connection string in VB (using the DSN) but importantly without passing the UserID and Password information ( I'm not allowed to hard code password information). Thanks for your help.
 
can Do it, assume you have connection called con, placed two text boxes in the form (txtUID,txtPWD).

Dim con as new ADODB.connection

cmdOK_Click()
dim sUser,sPass as string

sUser=txtUID
sPass=txtPWD

con.open "DSN=DSN_Name;UID=" & sUser & ";PWD=" & sPass & ";"

end sub

This should work. If so please let me know
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top