现在可以执行这个存储过程了 m_precordset = m_pcommand->execute(0,0,adcmdstoredproc); 这个时候,如果接下来用 _variant_t ret_val = m_pcommand->parameters->getitem((long)0)->value; 那么将得不到值 而如果像下面这样调用的话就可以得到返回值了 m_precordset->close(); _variant_t output_para = m_pcommand->parameters->getitem((long)0)->value; ms ado.net给这一现象的回复是: you can think of a stored procedure as a function in your code. the function doesn’t return a value until it has executed all of its code. if the stored procedure returns results and you haven’t finished processing these results, the stored procedure hasn’t really finished executing. until you’ve closed the datareader, the return and output parameters of your command won’t contain the values returned by your stored procedure. 也就是说execute()函数应该看成是直到m_precordset关掉以后才会正确返回.