Thread: Populating Array Difficulty

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    27

    Populating Array Difficulty

    Code:
    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.

  2. #2
    Registered User
    Join Date
    Nov 2010
    Posts
    27

    Messed Up Posting

    The above posting summary should read:

    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. from 2D array to 1D array
    By cfdprogrammer in forum C Programming
    Replies: 17
    Last Post: 03-24-2009, 10:33 AM
  2. Replies: 7
    Last Post: 11-25-2008, 01:50 AM
  3. 1-D array
    By jack999 in forum C++ Programming
    Replies: 24
    Last Post: 05-12-2006, 07:01 PM
  4. Class Template Trouble
    By pliang in forum C++ Programming
    Replies: 4
    Last Post: 04-21-2005, 04:15 AM
  5. Help with an Array
    By omalleys in forum C Programming
    Replies: 1
    Last Post: 07-01-2002, 08:31 AM