VPicture field and Class Way

Steve Albin steve at steve-albin.com
Wed Jul 15 23:33:49 CDT 2009


I am able to run the two different Field_Picture examples to update a database with VPicture field.  When I try the same techniques in my app, I get empty fields when adding pictures.  

I notice there is no example for using VPicture in the Class Way set of examples.  Is it possible that VPicture does not work when opening the database with the Class Way?  That is the only difference I can see between my app and the examples.

In my app, the field in the table is created like so:
      self.pCoverPic = new VPicture("pCoverPic",1024)
      
Using VCursor, I try adding the field like so:
      cursor.PictureField(5).WritePictureAs(pic, EVPictType.kJPG, 50)
This way fails.

But, if I change the line to use Blob like this:
      cursor.BlobField(5).FromFile(f)
the database update will work, even though the field in the database is VPicture.  

I would just forget trying to use WritePictureAs, but I can't figure out how to cast a picture field as a string.


Steve


  
  
  
-- 
Steve Albin - Montclair, NJ
http://www.jazzdiscography.com/
http://www.steve-albin.com/


More information about the Valentina mailing list