When I connect SQL Server with an OLEDB, I used the connection word: "provider = sqloledb.1; data source = localhost; initial catalog = wroxbooks; trusted_connection = yes; user ID = sa; password =;" After the call is not normal connection.
ASP.NET Error Description: * Error While Accessing Data. User 'CXY / ASPNET' Failure Failed.
ASP error description: Microsoft OLE DB Provider for SQL Server (0x80040E4D) User 'Cxy / IUSR_CXY' Login failed.
Confident, the data source, account, and password are correct, and how to connect according to the error description
CXY / ASPNET or CXY / IUSR_CXY login? (I have clearly specified User ID = sa; password =;), after more
Trial test, finally put the trusted_connection = yes in the connection word; delete, success!
If you understand the principle of SQL Server login verification, you can know the meaning of Trusted Connection. There is a story about Authenticating Logins in SQL Server Architecture (SQL Server Architecture), and the excerpt is extracted as follows:
......
SQL Server 2000 Uses Two Types of Authentication: Windows Authentication
And SQL Server Authentication.
......
When Using Windows Authentication, You Do Not Have to Specify A Login ID
Or Password When You Connect to SQL Server 2000. Your Access To SQL
Server 2000 IS Controlled by Your Windows NT or Windows 2000 Account OR
Group, Which is automated when Log on to the Windows Operating
System on the client.
WHEN You Connect, The SQL Server 2000 Client Software Requests 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 2000 Group and User Accounts of the Client That
Opened The Connection. SQL Server 2000 Gets The User Account Information
From The Trusted Connection Properties and Matches Them Against The
Windows Accounts Defined As Valid SQL Server 2000 Logins. If SQL Server
2000 FINDS A Match, IT ACCEPTS The Connection. When Connect To SQLServer 2000 Using Windows 2000 Authentication, Your Identification IS
Your Windows NT or Windows 2000 Group or User Account.
SQL Server 2000 uses two different verification methods: Windows verification and SQL Server 2000 verification
When you use Windows to verify the connection, you don't have to specify a user ID and password, and the connection verifies the Group Account (Group Account) using Windows NT or 2000. To know: SQL Server 2000 Before connecting verification, users first use Windows NT or 2000 group accounts to successfully log in to SQL Server 2000 servers, and can create a trust connection, SQL Server from trust connection properties Get the user's account information, match and analyze it with Windows-defined account information, if the connection is successful, and this Windows account is used as the user ID connected to SQL Server 2000.
The connection word in the above includes: trusted_connection = yes; this means that the connection will use the trust connection method, but due to the Windows group account number before the connection (access IIS service account IUSR_ computer name in the ASP environment, in the ASP The .NET environment is an ASPNET to log in to the SQL Server 2000 server, which means that there is no trust connection, of course, the SQL Server 2000 connection is not successful.
Trusted_Connection = YES; delete or change to trusted_connection = NO; this will not be used in a trust connection method (i.e. Name; password = user password; SQL Server 2000 verifies this user ID and password, regardless of the Windows account.
About SQL Server 2000 settings (Connection verification uses Windows and SQL Server authentication, or only Windows authentication), you can start SQL Server 2000 Enterprise Manager and then set in the security configuration.