Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'
The request properties can not be supported by this ODBC Driver.
One of the following error occurs when trying to access a SQL database via Active Server Pages (ASP):
Microsoft OLE DB Provider for ODBC Drivers error '80040e21', Errors
The error occurs on the second access to the data. For example, using a form generated by the DataForm Wizard clicking on the ">>" button to view the next 10 records results in the error described above.
This issue occurs when all of the following conditions are met:
Active Server Pages that have forced NT LanMan (NTLM) authentication either by disabling "Allow Anonymous" and enabling "NT Challenge/Response" or by setting Web permissions that would force a NT Challenge/Response.
The Web browser on a different machine than the Internet Information Server (IIS).
The recordset object stored in a Session variable.
NOTES: In this scenario, if BASIC/Clear Text is turned on and NTLM is turned off, then this script runs correctly. NTLM makes this problem surface.
When the allow Anonymous User context is turned off, NT is closing the pipe to SQL Server after the first request is complete. This is because the first connection to SQL Server is made under the IIS Anonymous User account. IIS then either impersonates the browser client on that same thread, or tries to access the connection on a different thread that is running in the impersonated user context. In either case NT would detect the attempt to use a network named pipe handle that had been opened in a different user context and force the pipe closed, per its security rules.
When the connections are viewed on the SQL Server with a network monitor, a name pipe close request comes from NT, causing the error in the Web browser.
There are two relatively easy workarounds:
If SQL Server is running on the same machine as IIS, you can use a local named pipe connection instead of a network named pipe connection. NT security rules would not be forced as the pipe is a local connection, rather than a network connection that can be impersonated by the Anonymous User account. In the SQL Server connection string of the Global.asa file, change the keyword SERVER=machinename to SERVER=(local). The server name "(local)" with parenthesis is a special keyword to the SQL Server ODBC driver.
You can use a non-authenticated protocol between IIS and SQL Server, such as TCP/IP sockets. This works when SQL Server is running on either the same machine or a different machine than IIS. To do so, you must configure both the SQL Server and the SQL Server client on the IIS machine:
a. To configure SQL Server to listen on TCP/IP sockets as well as
named pipes, run SQL Setup. From the Microsoft SQL Server 6.5
Options dialog box, click Change Network Support and Continue.
Select the entry for TCP/IP Sockets (leave Named Pipes also
selected) and click OK. Accept the default Named Pipe name and
TCP/IP Socket number. Exit SQL Setup. Stop and restart SQL Server.
b. To configure the SQL Server client on the machine running IIS (the
same or different machine as the SQL Server), select SQL Client
Configuration Utility. Click the Net Library tab and select "TCP/IP
Sockets" as the Default Network. Click Done. IIS should now use
TCP/IP sockets when connecting to SQL Server.
One of the following errors occurs when passing a date to a SQL Stored Procedure:
Microsoft OLD DB Provider for ODBC Drivers error 80004005
At least one parameter contained a type that was not supported.
Microsoft OLD DB Provider for ODBC Drivers error 80040e21
Driver not capable.
The data type of the parameter being passed to the stored procedure does not match the data type the stored procedure is expecting. For example, passing a value of "7/21/97" to a stored procedure that is expecting DateTime data will cause the error.
Make sure the data type you are passing to the stored procedure is of the same type as the stored procedure is expecting. Using Visual InterDev's Data Command control to create the Active Server Pages (ASP) code to call your stored procedure will ensure the parameter is of the correct type