Showing posts with label odbc. Show all posts
Showing posts with label odbc. Show all posts

Monday, March 26, 2012

Login failed for user (null). Reason: Not associated with a trusted SQL Server connection.

Anyone,

I have a user "john" whose machine is part of the "job" domain. He is
trying to establish an odbc connection to an MS SQL 2000 server on the
"school" domain. He uses Windows authentication to establish the odbc
connection however it gives the error "Login failed for user '(null)'.
Reason: Not associated with a trusted SQL Server connection."

I am guessing that the odbc connection is trying to pass the
credentials of job\john to the sql server. And since the sql server
is on the school domain it expects the credentials of school\john. Is
there anyway to specify the username and password so that this will
work even though the servers are on different domains without having
to trust the domains? Thanks in advance for
any help on this!!

TonyTo log into SQL Server, the user needs a SQL Server login. If your SQL
Server is set up to use NT Authentication or mixed mode authentication on
the Schools domain, then give John a login on the Schools domain and have
him login using those credentials.

"TBone" <tony.despain@.gmail.com> wrote in message
news:64b1ef71.0411261033.1044c9e9@.posting.google.c om...
> Anyone,
> I have a user "john" whose machine is part of the "job" domain. He is
> trying to establish an odbc connection to an MS SQL 2000 server on the
> "school" domain. He uses Windows authentication to establish the odbc
> connection however it gives the error "Login failed for user '(null)'.
> Reason: Not associated with a trusted SQL Server connection."
> I am guessing that the odbc connection is trying to pass the
> credentials of job\john to the sql server. And since the sql server
> is on the school domain it expects the credentials of school\john. Is
> there anyway to specify the username and password so that this will
> work even though the servers are on different domains without having
> to trust the domains? Thanks in advance for
> any help on this!!
> Tony|||Hi

The school domain needs to trust the job domain to allow this to occur. You
could use SQL Server authentication instead if you don't want this trust to
occur.

John

"TBone" <tony.despain@.gmail.com> wrote in message
news:64b1ef71.0411261033.1044c9e9@.posting.google.c om...
> Anyone,
> I have a user "john" whose machine is part of the "job" domain. He is
> trying to establish an odbc connection to an MS SQL 2000 server on the
> "school" domain. He uses Windows authentication to establish the odbc
> connection however it gives the error "Login failed for user '(null)'.
> Reason: Not associated with a trusted SQL Server connection."
> I am guessing that the odbc connection is trying to pass the
> credentials of job\john to the sql server. And since the sql server
> is on the school domain it expects the credentials of school\john. Is
> there anyway to specify the username and password so that this will
> work even though the servers are on different domains without having
> to trust the domains? Thanks in advance for
> any help on this!!
> Tony

Monday, March 19, 2012

Login failed error when conneting to mirrored db.

Hi All,

I have been struggling to make my classic ASP to call mirrored db successfully for the last few days. I am using a ODBC SQL Native Client. The front end application works perfectly untill the database is switched from principal to mirror server. I am getting the following error.

Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'

[Microsoft][SQL Native Client][SQL Server]Cannot open database "testDb" requested by the login. The login failed.

I will briefly explain what I have done. I hae created a SQL Login testUser and this login has the dbowner rights to testDb. This is being done in Principal server. Till now the application works fine. Once I switch it to failover, the mirror server acts as a principal - this is what I was expecting. On database level it works. But my ASP application doesnot seem to like it. When I closely looked into the security, I found that testUser does exist in the testDb but the real problem is testUser is not associated with testUser Login. It's not possible to change as well.

Any sort of pointer is appreciated.

Many thanks.

Sincerely,

Milan G

To correct the issue with the user not being tied properly to the Login, take a look at sp_change_users_login in BOL. When failing over, this will need to be run against all SQL users to tie them back to their logins. If you're able to use Windows authentication, that's preferable since the SIDs are the same and you don't need to mess with doing this.

|||

Hi M,

Many thanks for the pointer. Finally, I succeeded with your pointer. I found the this link a useful. http://www.mssqltips.com/tip.asp?tip=1166

cheers,

Milan G

Login failed error when conneting to mirrored db.

Hi All,

I have been struggling to make my classic ASP to call mirrored db successfully for the last few days. I am using a ODBC SQL Native Client. The front end application works perfectly untill the database is switched from principal to mirror server. I am getting the following error.

Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'

[Microsoft][SQL Native Client][SQL Server]Cannot open database "testDb" requested by the login. The login failed.

I will briefly explain what I have done. I hae created a SQL Login testUser and this login has the dbowner rights to testDb. This is being done in Principal server. Till now the application works fine. Once I switch it to failover, the mirror server acts as a principal - this is what I was expecting. On database level it works. But my ASP application doesnot seem to like it. When I closely looked into the security, I found that testUser does exist in the testDb but the real problem is testUser is not associated with testUser Login. It's not possible to change as well.

Any sort of pointer is appreciated.

Many thanks.

Sincerely,

Milan G

To correct the issue with the user not being tied properly to the Login, take a look at sp_change_users_login in BOL. When failing over, this will need to be run against all SQL users to tie them back to their logins. If you're able to use Windows authentication, that's preferable since the SIDs are the same and you don't need to mess with doing this.

|||

Hi M,

Many thanks for the pointer. Finally, I succeeded with your pointer. I found the this link a useful. http://www.mssqltips.com/tip.asp?tip=1166

cheers,

Milan G

Monday, February 20, 2012

Logging on with SA account!

I am attempting to connect to SQL7.0 via the SA account via an ASP page and having the message:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'WRIGHT\IUSR_WRIGHT'.
Any ideas?This is the anonymous login that IIS uses. Right click on default web site under Internet Services Manager. Click on properties -> Directory Security tab -> Click Edit under the Anonymous access-> Click Edit under the Anonymous access -- you will see this user name.|||Thanks very much...

so simple when you know how!!