The information in this article applies to:
SYMPTOMSThe following information only applies to the OLEDB Provider for ODBC: When using the Refresh method on a Command object's Parameters Collection for retrieving provider-side parameter information of a stored procedure, parameter information may not be correct. For example, if a stored procedure is specified in the CommandText property along with a parameter, and the parameter type is a SQL Server Text type, you will not get the correct ActiveX Data Objects (ADO) type returned for that parameter. CAUSEExecuting the following Visual Basic code on the stored procedure below produces the following error: The error occurs because the type of the parameter retrieved by the Refresh method is adChar instead of adLongVarchar. Visual Basic Code
SQL Server Stored Procedure
RESOLUTIONExecuting the same procedure with the following code resolves the problem. Note here that the CommandText uses the ODBC syntax for calling stored procedures. The CommandType is set to adCommandText. Code Example
STATUSThis behavior is by design. REFERENCESFor additional information about refreshing ADO parameters for stored procedures, please see the following article in the Microsoft Knowledge Base: Q174223 HOWTO: Refresh ADO Parameters for a Stored Procedure Additional query words:
Keywords : kbADO kbADO200 kbDatabase kbGenInfo kbSQLServ kbStoredProc kbVBp kbVC kbVJ kbGrpVBDB kbGrpMDAC kbDSupport kbIIS kbMDAC200 kbADO210sp2 |
Last Reviewed: November 4, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |