Understand the trust connection for SQL Server 2000 (Trusted connection)

Source: Internet
Author: User
Tags include log connect sql net ole valid access
When I connect SQL Server with OLE DB, I use the connection word: "Provider=SQLOLEDB.1;Data source=localhost;initial catalog=wroxbooks; Trusted_connection=yes; User Id=sa; password=; "
The connection has not been normal since the call.

Asp. NET error Description:
* Error while accessing data.
User ' Cxy\aspnet ' login failed.

ASP error Description:
Microsoft OLE DB Provider for SQL Server (0x80040e4d)
User ' Cxy\iusr_cxy ' login failed.

Convinced that the connected data source, account number and password are correct, based on the description of the error, how the connection will be used

Cxy\aspnet or Cxy\iusr_cxy login? (I have explicitly specified user id=sa; password=;), after too much

Test, and finally the connection word in the Trusted_connection=yes, delete, connect successfully!

If you understand the rationale for SQL Server login verification, you can know what trusted connection means.
In the SQL Server architecture (SQL Server architecture) login article, there is an excerpt of the authenticating logins (login authentication) as follows:


SQL Server uses two types of authentication:windows authentication

and SQL Server authentication.


When by using Windows authentication, you don't have to specify a login ID

or password when you connect to SQL Server 2000. Your access to SQL

Server controlled by your Windows NT or Windows?

Group, which is authenticated when your log on to the Windows operating

System on the client.

When you connect, the SQL Server requests client software a Windows

trusted connection to SQL Server 2000. Windows does not open a trusted

Connection unless the client has logged on successfully using a valid

Windows account. The properties of a trusted connection include the

Windows NT and Windows group and user accounts of the client that

Opened the connection. SQL Server Gets the user account information

From the trusted connection properties and matches them against the

Windows accounts defined as valid SQL Server logins. If SQL Server

Finds a match, it accepts the connection. When you connect to SQL

Server using Windows authentication, your identification is

Your Windows NT or Windows group or user account.

SQL Server 2000 takes two different forms of authentication: Windows Authentication and SQL Server 2000 authentication

When you use Windows to authenticate a connection, you do not have to specify a user ID and password, and the connection verifies a group account that uses Windows NT or 2000.
You know: SQL Server 2000 before connection authentication, a user can establish a trusted connection (Trusted connection) by using a Windows NT or 2000 group account to successfully log on to a SQL Server 2000 server on the client side, SQL The Server obtains the user's account information from the Trust connection properties, matches and analyzes the account information defined by Windows, and if the connection succeeds correctly, the Windows account is used as the user ID connected to SQL Server 2000.

The connection words in the above include: Trusted_connection=yes;
This means that the connection will take the form of a trusted connection, but is logged on to the SQL Server 2000 Server because the Windows group account was not used before the connection (in the ASP environment to access the IIS service account IUSR_ computer name, and the account number is ASPNET in the ASP.NET environment). This means that no trust connection has been established (Trusted connection), and of course the SQL Server 2000 connection cannot succeed.

to Trusted_connection=yes; Delete or change to trusted_connection=no;
This will not take the form of a trusted connection (i.e., Windows authentication), but rather the SQL Server 2000 authentication method, which is specified in the connection word: User id=user name; Password=user Password;
SQL Server 2000 authenticates this user ID and password, regardless of the Windows account.

For the settings for the two authentication methods described above in SQL Server 2000 (connection validation using Windows and SQL Server authentication or only Windows authentication), you can start SQL Server 2000 Enterprise Manager, and then set up in the security configuration.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.