Populating Array Difficulty
-
I have built a program utilizing ADO to pull data from an Access Database. I am having problems taking this data which is formated as a _variant_t data type to a floating point array in C++. The following is the initial format of the array and the process that is attempting to populate this array. Can someone help me with a good source to learn about these conversions? Secondly, can someone help me with the proper code for the array so that it can be populated? At the bottom is the error message I am getting. const int arraySize = 5000; _variant_t OpenArr[arraySize]; ADODB::_RecordsetPtr recOpen = NULL; while(!recOpen->EOFile) { record++; Open = pOpenField->Value; Open.ChangeType(VT_R4); printf("Data_Open: %4.5f\n", Open.fltVal); printf("Record: %d\n", record); OpenArr[record]=recOpen->GetRows(-1,0); recOpen->MoveNext( ); } Data_Open: 1.41283 Record: 1 Error Code = 800a0d5d Code meaning = U Source = ADODB.Recordset Description = Application uses a value of the wrong type for the current operation.
-
I have built a program utilizing ADO to pull data from an Access Database. I am having problems taking this data which is formated as a _variant_t data type to a floating point array in C++. The following is the initial format of the array and the process that is attempting to populate this array. Can someone help me with a good source to learn about these conversions? Secondly, can someone help me with the proper code for the array so that it can be populated? At the bottom is the error message I am getting. const int arraySize = 5000; _variant_t OpenArr[arraySize]; ADODB::_RecordsetPtr recOpen = NULL; while(!recOpen->EOFile) { record++; Open = pOpenField->Value; Open.ChangeType(VT_R4); printf("Data_Open: %4.5f\n", Open.fltVal); printf("Record: %d\n", record); OpenArr[record]=recOpen->GetRows(-1,0); recOpen->MoveNext( ); } Data_Open: 1.41283 Record: 1 Error Code = 800a0d5d Code meaning = U Source = ADODB.Recordset Description = Application uses a value of the wrong type for the current operation.
Have you Googled for 800a0d5d?
Mike Certini wrote:
OpenArr[record]=recOpen->GetRows(-1,0);
Have you tried other arguments to
GetRows()
? I've never used it, but-1
looks odd as the number of rows to retrieve."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Have you Googled for 800a0d5d?
Mike Certini wrote:
OpenArr[record]=recOpen->GetRows(-1,0);
Have you tried other arguments to
GetRows()
? I've never used it, but-1
looks odd as the number of rows to retrieve."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
According to what I have read, this is a proper parameter. Here is a link: http://msdn.microsoft.com/en-us/library/ee266344(v=BTS.10).aspx[^]
-
According to what I have read, this is a proper parameter. Here is a link: http://msdn.microsoft.com/en-us/library/ee266344(v=BTS.10).aspx[^]
My bad. I was using a slightly aged version of MSDN.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius