Hi,
I'm using ADO to extract data from SQL server. I have an object that runs a stored procedure and returns a recordset successfully.
I'm using GetRows() to populate my SAFEARRAY. I then try to find the Ubound Property using SafeArrayGetUBound and I always retrun zero???
I've not had much experience with SAFEARRAY's does anyone know what I'm doing wrong?
bool SQLStoredProc::GetRows()
{
if (m_RSPtr == NULL)
return false;
try {
m_vArrRows = m_RSPtr->GetRows(ADODB::adGetRowsRest);
HRESULT hr = SafeArrayGetUBound(m_vArrRows.parray, 1,&m_lUbound);
}
catch (_com_error e)
{
ATLTRACE(_T("Exception thrown: %s\n"), (LPCTSTR)e.Description());
return false;
}
return true;
}
Open in new window