Click to See Complete Forum and Search --> : How to use Ado to run query with parameter


sunhongwei
April 21st, 1999, 11:45 PM
DBViewer is sample project about how to use Ado,which is distributed by msdn.
when I use a funciton named "CallProcedure" in it to set the parameter in a query of a Access database and run it,But I meet a problem,code is follow:
HRESULT GetRowset(const CSession& session, const GUID& guidSchema, IRowset** ppRowset)
{
ATLASSERT(session.m_spOpenRowset != NULL);
CComPtr<IDBSchemaRowset> spSchemaRowset;
HRESULT hr;

hr = session.m_spOpenRowset->QueryInterface(IID_IDBSchemaRowset, (void**)&spSchemaRowset);
if (FAILED(hr))
return hr;

return spSchemaRowset->GetRowset(NULL, guidSchema, nRestrictions,
m_pvarRestrictions, IID_IRowset, 0, NULL, (IUnknown**)ppRowset);
}
the return value decided by last row should be S_OK,but it isn't.
My question is why it (problem) occurs.
If you can help me,Please answer me quickly,I'm eagarly to use it,thank you very much
My email is sunhongwei@371.net