Connecting to the mssql server from a remote computer gives login error for user '

I get this error when I try to connect to a remote SQL server using this connection string.

Mistake:

ODBC error: 28000118452 [Microsoft] [ODBC SQL Server Driver] [SQL Server] User login failed. '' The user is not associated with a reliable SQL Server connection.

Connection string:

"DRIVER = {SQL Server}; SERVER = TestServer, 1433; Trusted_Connection = {Yes};"

Note that this same connection string works fine if I specify the local computer.

My question is: why does the remote SQL server consider my username to be empty? "

I made a valid login using the WNetAddConnection Win32 API for the remote machine.

Edit: I get the same error when connecting from management studio. But I thought that my program would have a better chance of working, since I first established a connection to the remote machine.

Edit2: Note. I really need a solution using windows authentication. I already have work with SQL authentication.

+5
source share
3 answers

Thoughts:

1.) are both cars in the same area? I think, probably because of your links to linking to WNet * ...

If not, integrated security will cause problems.

: , . Integrated Security, , SQL Server, , .

: .

:     , SQL Servers. , SQL Server, , . .

2.) , SPN .

, :

setspn -L _

SPN :

MSSQLSvc/_: 1433

3.) Edit: , , , /, .

, brian , "letmein".

+1

, SQL, .

. , SQL Server Windows

0

I think the error may be caused by the fact that the UserId section is not full (which is true for Windows Auth).

Try a connection string, for example:

Server = myServerAddress; Database = MyDatabase; Trusted_Connection = True;

Another alternative that should be identical:

Data Source = myServerAddress; Start Directory = MyDatabase Integrated Security = SSPI;

-1
source

All Articles