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!

SQL Login

Status
Not open for further replies.

clayton74

Technical User
Apr 17, 2002
187
GB
Hello All

I am trying to create a form that requires authentication from an SQL login to access

I have a form with a username textbox and a password textbox and I am trying to allow login

' Open a connection by referencing the ODBC driver.
cnn.ConnectionString = "driver={SQL Server};" & _
"server=laptop;uid=username;pwd=password;database=Logging"

I have tried
' Open a connection by referencing the ODBC driver.
cnn.ConnectionString = "driver={SQL Server};" & _
"server=laptop;uid='" & txt_user.Text & "';pwd='" & txt_pass.Text & "';database=Logging"

But get login failed for user "sa"

Any help would be gratefully received
 
You don't need the single quotes around the username and password.
Code:
   cnn.ConnectionString = "driver={SQL Server};" & _
      "server=laptop;uid=" & txt_user.Text & ";pwd=" & txt_pass.Text & ";database=Logging"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top