The information in this article applies to:
SUMMARYAdovcsp.exe is a sample program that demonstrates opening keyset and forwardOnly cursors using ActiveX Data Objects (ADO) Recordsets by executing stored procedures on Microsoft SQL Server. It also shows how to open a disconnected record set. The sample uses the Visual C++ #import feature and demonstrates ADO Recordset GetState(), Parameters GetName() and GetValue(), and many other Recordset, Command and Connection methods. MORE INFORMATIONThe following file is available for download from the Microsoft
Download Center. Click the file name below to download the file: ADOVCSP.EXERelease Date: May-01-1998 For 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. The application assumes that you have a local Microsoft SQL Server installed with the pubs database. If this is not the case, change the code in the openConn() function:
Replace server=(local) with the name of your server and specify the name of
your database. The sample creates two stored procedures and a table, and then drops them when the application exits.The OpenRd method takes an input parameter (GradYear) and passes it to the stored procedure sp_AdoTestInOut. sp_AdoTestInOut returns all the records with GradYear >= to the parameter passed. It returns an output parameter, the number of records returned and also returns a parameter (the max GradYear). The student table created is based on the Student table of the Student Enrollment database that ships with Visual C++. In this sample, the text boxes to show the Output parameter and Return code are only used when running the stored procedure by clicking the OpenRead button. Please see the source code for more details. The Supports button obtains the schema information from the database using the technique and code described in the following Microsoft Knowledge Base article: Q182831 HOWTO: Using the ADO OpenSchema Method from Visual C++The Open DisCon button opens a disconnected recordset. This code is taken from the following Microsoft Knowledge Base article: Q184397 HOWTO: Getting ADO Disconnected Recordsets in VBA/C++/Java
REFERENCESFor more information, please see the following articles in the Microsoft Knowledge Base: Q182389 FILE: Adovcbm.exe ADO 1.5 with #import and Getrows/Bookmarks Additional query words: kbdse
Keywords : kbfile kbDatabase kbGrpVCDB kbGrpMDAC kbDSupport |
Last Reviewed: December 14, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |