The information in this article applies to:
SUMMARYWhen using ActiveX Data Objects (ADO) to pass parameters to a stored procedure, you may get the following error:
MORE INFORMATION
This error can occur if you attempt to set the TYPE of a parameter in an ADODB command object's parameters collection to a type that is not supported by the data provider.
This stored procedure returns an output parameter of type int indicating the number of employees hired before a given date. The date is passed to the stored procedure as a parameter, and the number of employees is passed to the calling program as an output parameter. Now create an ADO application to use the stored procedure. The example given is written in Visual Basic.
When the sample code is run, it gives this error:
This is because SQL Server does not support the adDBDate datatype. To correct this problem, change the datatype of the @theDate parameter to adDBTimeStamp. In order to determine the number, names, types, and sizes of parameters needed in a stored procedure, use the Parameters.Refresh method of the command object. You can call this method during development of your application to determine the correct requirements for the stored procedure, then remove the expensive call to Parameters.Refresh after you have gathered the necessary data. Additional query words: SQL Server ADO ActiveX Data Objects ODBC Database
Keywords : kbADO200 |
Last Reviewed: April 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |