1. Joaquin Flores
  2. PowerBuilder
  3. Wednesday, 18 September 2019

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
2
Votes
Undo

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.
  1. Wednesday, 18 September 2019
  2. PowerBuilder
  3. # 1
Chris Pollach Accepted Answer Pending Moderation
0
Votes
Undo

Hi Joaquin;

 Check out this example at the Anvil of Time website.

HTH

Regards ... Chris

Comment
There are no comments made yet.
  1. Wednesday, 18 September 2019
  2. PowerBuilder
  3. # 2
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.