0

I'm new to SQL in general. I wrote a long time ago a software using ADO libraries in VB.Net but now I'm moving toward pure SQL statements.

I'm trying to figure out a problem in my connection string with non-administrator users. The server has different user according the person that logs-in from the client. Each user has their own privileges and so on.

When a client start the program they connect to the main database on the server using this connection string:

Data Source=PC-SERVER\SQLEXPRESS;Initial Catalog=dbVarese;Integrated Security=SSPI; User ID=sa;Password=(password);

The exception generated from the jit debugger is that it is unable to connect to the database for the user DOMAIN\Test1.

As I said before, the problem comes up only when I'm trying to connect using a user that is not flagged as administrator.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • I thought it was "... Integrated Security=true; user....." for when you specify a windows user and password (as opposed to SQL auth) – Anthony Horne May 05 '14 at 11:00
  • Are you using auto generated SQL connection? Please check your config file whether a SQL Connection defined for windows authentication? It is possible if you auto generated datasets. – anbuj May 05 '14 at 11:36

1 Answers1

1

Remove username and password form the Connection String, and it will attempt to connect using the Windows Credentials.

"data Source=XXXX;Initial Catalog=XXXXXX;Integrated Security=SSPI"

In SQL Server be sure that your user is set up for Windows Authentication

Jon Milliken
  • 121
  • 11