el error que sale es
[Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or function 'test' expects parameter '@UserTipo', which was not supplied.
si ejecuto "EXECUTE test 'US'" funciona perfectamente.
Código PHP:
// configuracion Datos Tango
$GestionBD_hostname = "server";
$GestionBD_username = "sa";
$GestionBD_password = "";
$GestionBD_type = "odbc_mssql";
$GestionBD_basededatos = "MYDB";
$GestionBD_dbdns = "Driver={SQL Server};Server=" . $GestionBD_hostname . ";Database=" . $GestionBD_basededatos . ";";
$GestionBD = NULL;
$GestionBD =& ADONewConnection($GestionBD_type);
$GestionBD->debug = false;
$GestionBD->Connect($GestionBD_dbdns, $GestionBD_username, $GestionBD_password);
$GestionBD->SetFetchMode(ADODB_FETCH_ASSOC);
$TipoUsuario = "US";
$stmt = $GestionBD->PrepareSP("test", false);
$GestionBD->InParameter($stmt, $TipoUsuario,"UserTipo");
$recordSet = $GestionBD->Execute($stmt);
print '<pre>';
print_r($stmt);
print '</pre>';
if (!$recordSet)
{
print $GestionBD->ErrorMsg();
}
else
{
print "<table>\n";
while (!$recordSet->EOF)
{
print "<tr>\n";
for ($x=0; $x<$recordSet->FieldCount();$x++)
{
$fld = $recordSet->FetchField($x);
$type = $recordSet->MetaType($fld->type);
print "<td>";
print $recordSet->Fields($fld->name);
print "</td>\n";
}
$imprimirColumna = false;
$recordSet->MoveNext();
print "</tr>\n";
}
print "</table>\n";
}