Example8 - Handling Procedure Output Parameters

DB Library for C

DB Library for C

Example8 - Handling Procedure Output Parameters

Example8 illustrates DB Library support for output parameters in Microsoft® SQL Server™ stored procedures.

Default Location

C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\DBLib\Example8

Running the Sample
  1. Open Example8.dsw in Microsoft Visual C++® 6.0.

  2. From the Tools menu, choose Options, and then click the Directories tab.

  3. From the Show directories for box, choose Include files and Library files, and ensure that the following directories (as appropriate) are included:
    • Include files: C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Include

    • Library files: C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Lib
  4. Ensure that the hard-coded server name, user name, and password are correct.

  5. Compile the program.

  6. Create the stored procedure, rpctest by running C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\DBLib\Example8\Createsp.sql).

  7. Open a Command Prompt window, and then change the current directory to C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\DBLib\Example8.

  8. Run the program by entering "example8".
Functions Illustrated
Dbinit dbresults
Dbmsghandle dbprrow
Dberrhandle dbnumrets
Dblogin dbretname
DBSETLUSER dbrettype
DBSETLPWD dbprtype
DBSETLAPP dbretlen
DBSETLVERSION dbretdata
Dbopen dbhasretstat
Dbrpcinit dbretstatus
Dbrpcparam dbexit
Dbrpcsend DBDEAD
Dbsqlok  

See Also

Samples