Sign in to follow this  

Populating Array Difficulty

This topic is 2591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites

This topic is 2591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this