If I loop thrue the records and load them manualy (see code below) it works.
So there is a recordset. If I use the sample app, i get this message :
The opened ADO recordset object has changed the requested record scrolling type to **adOpenForwardOnly**
(this may caused by limited cursor library implementation of currently used OLE-DB provider)
On the example app i use the following Connectionstr:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ALKIDEV;Data Source=BTTSRVDB02
If I change adOpenForwardOnly or any other settings I never get a result back in ADOrecordsetView !
Query is as SP:
exec spQueryVertreterBeleg @VertreterID = 0, @vonDatum = ’20100101’, @bisDatum = ’20101231’
Manuell loop and load to the grid (its a wrapper class I wrote) :
_variant_t var;
CString strMsg;
long Index = m_objAdoRS->GetFields()->Count;long RecCount = 0;// loop thru the recordset
{
{
var = m_objAdoRS->GetFields()->Item[x]->Value;
while (! m_objAdoRS->GetADOEOF())for (long x = 0; x < Index; x++)switch (var.vt) //m_objAdoRS->GetFields()->Item[x]->Type)
{
case VT_EMPTY:case VT_NULL: // empty
{
{
InsertItem(RecCount, _T(
}
if (x == 0)"NULL"));else
{
SetItemText(RecCount, x, _T(
}
}
{
AddRow(RecCount);
}
SetItemNumber(RecCount, x, var.fltVal);
{
AddRow(RecCount);
}
SetItemNumber(RecCount, x, var.dblVal);
{
AddRow(RecCount);
}
SetItemNumberLong(RecCount, x, var.iVal);
{
AddRow(RecCount);
}
SetItemNumberLong(RecCount, x, var.intVal);
{
AddRow(RecCount);
}
SetItemNumberLong(RecCount, x, var.lVal);
{
AddRow(RecCount);
}
SetItemNumberLong(RecCount, x, var.ulVal);
{
var.ChangeType(VT_R8);
{
AddRow(RecCount);
}
SetItemNumber(RecCount, x, var.dblVal);
}
{
{
AddRow(RecCount);
}
var.ChangeType(VT_R8);
SetItemNumber(RecCount, x, var.dblVal);
}
"NULL"));break;case VT_R4:if (x == 0)break;case VT_R8:if (x == 0)break;case VT_I2:case VT_UI1:if (x == 0)break;case VT_INT:if (x == 0)break;case VT_I4:if (x == 0)break;case VT_UI4:if (x == 0)break;case VT_DECIMAL:if (x == 0)break;case VT_CY:if (x == 0)break;case VT_BOOL: // boolean
{
strMsg = _T(
if (var.boolVal)"TRUE");else
strMsg = _T(
{
InsertItem(RecCount, strMsg);
}
"FALSE");if (x == 0)else
{
SetItemText(RecCount, x, strMsg);
}
}
break;case VT_ERROR: // Error
{
strMsg = _T(
{
InsertItem(RecCount, strMsg);
}
"ERROR");if (x == 0)else
{
SetItemText(RecCount, x, strMsg);
}
}
break;case VT_DATE: // datetime
{
COleDateTime dt(var.date);
{
AddRow(RecCount);
}
SetDateTimeCtrlDate(RecCount, x, dt);
if (x == 0)// index = 0 -> Insert Item!
}
break;case VT_BSTR: // bytestrings WCHAR and other strings
{
strMsg = var.bstrVal;
{
InsertItem(RecCount, (LPCTSTR) strMsg);
}
if (x == 0)else
{
SetItemText(RecCount, x, (LPCTSTR) strMsg);
}
}
}
}
m_objAdoRS->MoveNext();
RecCount++;
}
break;default:break;
m_objAdoRS->MoveFirst();