1. Joaquin Flores
  2. PowerBuilder
  3. Wednesday, 18 September 2019 01:06 AM UTC

Hi

 

I'm working with PowerBuilder 11.50, I have Logitch c170 WebCam, I need take photos to employees  and then save into database.

 

Are there any example to do this?

 

Regards

 

 

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 18 September 2019 03:26 AM UTC
  2. PowerBuilder
  3. # 1

For the way to store the files in the database:

- write the image to disk 

- use fileReadEx() to read it from disk into a blob variable in powerbuilder

- INSERT a new record in a table with a field of type CLOB / Binary / Long binary / etc. (depends on your DB provider)

- Use the UPDATEBLOB command in PB to assign the blob variable to it's corresponding field in the DB table.

 

You can also NOT write the file to disk and store the image directly as a blob into the database, but then you'll miss important file header information, which you'd need to view the image with any program. So I advice to always first write the image to disk, then insert into the database and if you don't want to keep the image on disk, delete the file from disk.

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 18 September 2019 01:26 AM UTC
  2. PowerBuilder
  3. # 2

Hi Joaquin;

 Check out this example at the Anvil of Time website.

HTH

Regards ... Chris

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.