Access return value of stored procedure via ODBC

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hi all,

I have a need to access the boolean return value of a MSSQL stored
procedure and cannot find the process to do so with ODBC, if even
possible. Searching around the Internet, i've seen some instruction on
accomplishing it with the mssql extension, but since I'm more
familiar with the ODBC extension I've started there first.

Rewriting the SP to return the value as a rowset is not an option, as
it is a built-in ASP.NET procedure.  I suppose the SP could be
wrapped in another SP that returns a rowset as a workaround.

$app = 'app';
$uname = 'user';
$role = 'role';

$conn = odbc_connect('DSN','user','pass');
$stmt = odbc_prepare($conn,
    'CALL aspnet_UsersInRoles_IsUserInRole(?,?,?)')
$result = odbc_execute($stmt, array($app,$uname,$role);

Here, $result is bound as a resultset resource.  Is there another
way to bind a PHP variable to the SP's return value?

If this cannot be done with PHP's ODBC, I can focus my efforts on
learning php-mssql instead.  Thanks for your input.

Site Timeline