Unable to store CLongBinary or CByteArray as OLE Object in Jet 3.5 
Author Message
 Unable to store CLongBinary or CByteArray as OLE Object in Jet 3.5

Hello!

I am unable to retreive binary data filed to a Jet 3.5 CDaoRecordset.  I
assume that it is correctly filed because it doesn't throw an exception.
(See sample code attached.)

After filing the record, I set the bookmark to the last modified record.
But GetSize reports zero, and the data pointer member is NULL.

Has anyone ever used the CLongBinary or CByteArrays to store things like
rich text, BMP's or WAV files?

Any comments much appreciated.

Kind Regards,


void CBinaryTestView::OnButton1()
{
  CDSIRTF dsirtf; // This is a CDaoRecordset with a member variable:
CByteArray m_brNote, as generated by ClassWizard

 int iSize; // max size of CByteArray

 BYTE byte; // buffer for byte data

 try
 {
  dsirtf.Open();

  dsirtf.AddNew();

  dsirtf.m_brNote.SetSize(3);

  dsirtf.m_brNote.SetAt(0, 5);
  dsirtf.m_brNote.SetAt(1, 6);
  dsirtf.m_brNote.SetAt(2, 7);

  iSize = dsirtf.m_brNote.GetSize(); //  size will be reported as 3, as I
would expect
  dsirtf.Update();

  dsirtf.SetBookmark(dsirtf.GetLastModifiedBookmark()); // Set the current
record to the one just filed.

  iSize = dsirtf.m_brNote.GetSize(); // size will be reported as ZERO!!!

  // since iSize is ZERO, these are not valid elements.
  byte = dsirtf.m_brNote.GetAt(0); // invalid
  byte = dsirtf.m_brNote.GetAt(1); // invalid
  byte = dsirtf.m_brNote.GetAt(2); // invalid

  dsirtf.Close();

 }
 catch(CDaoException* e)
 {
  delete e;
 }
 catch(CMemoryException* e)
 {
  delete e;
 }

Quote:
}



Sun, 18 Aug 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Annoying Jet 3.5 OLE DB deployment problems

2. Problem intalling Microsoft Jet 3.5

3. How Do I Remove a User with Jet 3.5 and VC++

4. VC 4.2 with Jet 3.5

5. Jet 3.5

6. Rebuilding dbDAO to use Jet 3.5?

7. Rebuilding dbDAO to use Jet 3.5?

8. ADO/ATL/Jet 3.5 Provider problem

9. Jet 3.5 Error

10. Help - DAO and JET 3.5 and Memory Usage

11. Jet 3.5 Database keeps corrupting

12. Does JET 3.5 work on SMP machines?

 

 
Powered by phpBB® Forum Software