The information in this article applies to:
SUMMARY
This article describes how to use the ODBC API to bind input, output, and
return values to parameters of stored procedures. This is a workaround
using the rdoPreparedStatement object to accomplish this behavior.
or RDO generates the error the first time you access the rdoParameters collection (check the Count property or try to get an item from it), because RDO calls SQLDescribeParam or SQLProcedureColumns and attempts to build the parameters collection at that time. NOTE: RDO uses SQLProcedureColumns if the SQL uses the ODBC {Call} syntax and SQLDescribeParam for all others, such as the proprietary Execute for SQL Server. One way to avoid this problem is to pass the input parameters to your stored procedure "in-line," without using an rdoPreparedStatement. The following line of code demonstrates this: NOTE: Oracle 7.2 cannot return a result set from a stored procedure.
In the case of this sample, a stored procedure named GetNames received one input parameter with the value of "Jones," and should return a result set with each row from the table that contained that value in a certain column. This works fine for a stored procedure that only accepts input parameters, but it is not useful for a stored procedure that returns output parameters or return values. To work around this problem, a class module has been developed that uses the ODBC API to call your parameterized stored procedure without the use of SQLDescribeParam or SQLProcedureColumns. This class module does not have the ability to return a result set from the stored procedure, but you can set multiple input, output, and return values. This sample, Odbcbind.exe, is available for download as a class module that you can include in your application or compile into an OLE DLL. MORE INFORMATIONNOTE: Odbcbind.exe requires the installation of Visual Basic 4.0, 5.0, or 6.0 Enterprise Editions on Windows NT or Windows. Odbcbind.exeFor more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address http://www.microsoft.com/downloads/search.aspand then click How to use the Microsoft Download Center. REFERENCES
Open Database Connectivity (ODBC) SDK, version 2.10, "Programmer's
Reference," on the Microsoft Developer Network (MSDN) CD-ROM.
Additional query words:
Keywords : kbfile kbsample kbODBC kbRDO kbVBp kbVBp400 kbVBp600 kbWinOS98 kbGrpVBDB kbDSupport |
Last Reviewed: January 5, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |