Problems with VPicture

Steve Albin steve at steve-albin.com
Thu Jul 16 17:09:11 CDT 2009


I am running V4RB 4.1 on a Mac creating a standalone app.  For the life of me, I cannot get a picture inserted into a database.

I've tried both Field_Picture examples with success.  Then, I make a simple project on my own trying to replicate the procedure and no matter what I do it will not load a picture.  

Here is my code for adding a picture.  The pic is a picture I've added to the RB project.  It is located in the same folder as the project and the built project.

Here is the code I am using to add the picture.  I couldn't be simpler, but it doesn't work.

Sub Action() 
    dim pic As Picture 
    pic = DSC_0281 // a picture contained in the project folder

    vcImages = app.vDB.SQLSelect("Select Recid, *  from Images where false  ",
        EVCursorLocation.kServerSide, EVLockType.kNoLocks, EVCursorDirection.kRandom) 

    vcImages.SetBlank 
    'vcImages.PictureField("pCoverPic").WritePictureAs(pic) // tried this call both ways 
    vcImages.PictureField("pCoverPic").WritePictureAs(pic, EVPictType.kJPG, 50) 
  
    call vcImages.AddRecord()
    app.vDB.Flush
  
  
 I look at the log after running this and there is no indication of a problem.  There is no warnings file generated and I have it turned on.

Can anyone give me any pointers on a "gotcha" that I may have overlooked?  I have no problem adding VarChar, ULong, VText, VBoolean, and VDate fields to this database.  Just VPicture.

Steve

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


More information about the Valentina mailing list