1. Simone Olianti
  2. PowerBuilder
  3. Saturday, 11 April 2020 10:23 AM UTC

hello everyone i am having a problem with inkpicture control and since i am not very expert with it i might need some help.
I save the ink into my table as a blob but i am not able to load it back for showing

PB 2019 R2 - Sql Anywhere 16
i've created a long binary field on a table of my database where i would like to store the ink as a signature
to store it i tried this:

integer li_return
blob lblb_ink

li_return = ip_1.save(lblb_ink, 0, true)
UPDATEBLOB interventi SET firma = :lblb_ink WHERE id_interventi = :il_id_int;
IF sqlca.SQLNRows > 0 THEN
   COMMIT;
ELSE
   messagebox("Error",sqlca.sqlerrtext, stopsign!, ok!)
END IF

if i try to save the blob lblb_ink coming from the ink control to a picture file using filewriteex it's working since i can open the file saved without problems.
Data is stored in the table but i am not sure if it is readable cause when i try to load it back into the ink control or simply on a picture control using setpicture it's showing nothing. I've tried to save the blob again to a picture file coming from the table and it is different in size from the original one and so cannot be loaded (looks like corrupted)

to retrieve data i am using selectblob

        blob lb_firma
        long li_FileNum
        selectblob firma into :lb_firma from interventi where id_interventi = :il_id_int;
        if sqlca.sqlcode = 0 then             
//            li_FileNum = FileOpen("C:\start2\EMP_PICS.BMP", StreamMode!, Write!, Shared!, Replace!)
//            FileWriteEx(li_FileNum, lb_firma)    
//            fileclose(li_FileNum)        
            p_1.setpicture(lb_firma)
            ip_1.loadpicture(lb_firma)
      end if

any ideas or an example could be helpful!
tia,
simone

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Saturday, 11 April 2020 14:58 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Simone;

   The most likely cause is that the ODBC drivers have not been conditioned to handle a data stream > 32K. You need to set the data stream to a much higher value than the default by changing the PBODBCnnn.ini file or add overrides to your App's DBParm Field of SQLCA.

  Have a look in your PB help file about how to set the blob size maximum and text size minimum values in both the ODBC & native DB drivers.

Keywords: PBMaxBlobSize, PBMaxTextSize

Regards... Chris

Comment
  1. Simone Olianti
  2. Saturday, 11 April 2020 16:30 PM UTC
the same app from an android device (powerserver mobile) working good, but saving the ink picture from a browser web (powerserver web) resulting in data corrupted using updateblob. probably i am missing something but i am out of ideas at the moment
  1. Helpful
  1. Simone Olianti
  2. Saturday, 11 April 2020 16:32 PM UTC
ok my fault, made a full deploy from scratch and now working like a charm
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 13 April 2020 15:07 PM UTC
Hi Simone ... Thanks for letting us know that it's working now 100%. That's awesome! :-)
  1. Helpful
There are no comments made yet.
Simone Olianti Accepted Answer Pending Moderation
  1. Saturday, 11 April 2020 12:22 PM UTC
  2. PowerBuilder
  3. # 1

update:

if i save the blob returned by reference from the inkpicture control into a picture file and load it into my table using the following command from interactive sql, the ink is correctly loaded back into the ink control after a selectblob:

update interventi
set firma = xp_read_file('s:\start2\emp_pics.bmp')
where id_interventi = 2

looks like the updateblob doesn't store the correct data into the long binary field of the table
any ideas?

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.