Click to open or copy the files for the XP_DBlib sample.
This is a sample extended stored procedure using 32-bit Visual C++ and the DB-Library interface to open a new connection to the SQL Server that called the extended stored procedure. Returns a result set and passes the results to the client. Uses a bound session for the loopback connection.
This sample uses the following keywords:
dbclose; dbdata; dbdead; dbfreelogin; dbgetuserdata; dblogin; dbopen; dbprocerrhandle; dbprocmsghandle; dbsetlpwd; dbsetlsecure; dbsetluser; dbsetuserdata; dbsqlexec; err_handler; msg_handler; sprintf; srv_bzero; srv_impersonate_client; srv_paramdata; srv_paramlen; srv_paramtype; srv_pfield; srv_revert_to_self; srv_rpcparams; srv_senddone; srv_sendmsg; strcmp; xp_gettable