PRB: Parameters.Refresh Fails Using Parameter Token in Nested SQL (280084)
The information in this article applies to:
- Microsoft Data Access Components 1.5
- Microsoft Data Access Components 2.0
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft OLE DB Provider for SQL Server 7.0
- Microsoft OLE DB Provider for SQL Server 7.01
- Microsoft ODBC Driver for SQL Server 3.7
- Microsoft OLE DB Provider for SQL Server 2000 2000.80.194
- Microsoft ODBC Driver for SQL Server 2000 2000.80.194
This article was previously published under Q280084 SYMPTOMS
When you call the ActiveX Data Objects (ADO) Parameters.Refresh function on a SQL statement that contains parameter tokens inside of a nested SELECT statement, the following error may be reported by the SQL Server OLEDB Provider and SQL Server ODBC driver:
"Run-time error '-2147467259 (80004005)' Syntax error or access violation"
CAUSE
When you call Parameters.Refresh, ADO attempts to obtain parameter information from the OLEDB provider by using the OLEDB command ICommandWithParameters::GetParameterInfo. The SQL Server ODBC driver and SQL Server OLEDB Provider cannot resolve parameter information inside of nested SELECT queries, which causes the internal call to GetParameterInfo to fail.
RESOLUTION
You must manually specify the data types for all parameters by using the ADO CreateParameter function.
STATUS
This behavior is by design.
REFERENCESFor additional information, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
235053 PRB: E_FAIL Returned from Prepare() When SQL Statement Contains a Parameter in a Subquery
293790 BUG: SQLDescribeParam Causes Syntax Error or Access Violation
Modification Type: | Major | Last Reviewed: | 12/5/2003 |
---|
Keywords: | kbprb KB280084 |
---|
|