• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 267
  • Last Modified:

Upload image in pervasive database table

I need to upload images in Pervasive.SQL 9.5 database seating on server.

I created a new filed Image longvarbinary type in a table tblProduct  in pervasive database..
Now I need to add images that I have stored in my MSAccess table tblItems.
In this table I have a field Pictures OLE object type  where I stored jpg images.
Or  it could be from folder on my PC does not matter.

Is it possible to do this from Access 2003 and how?
If somebody has example or script that I can use to do this.

I dont know is this possible to be done directly from Pervasive.SQL database?
  • 2
  • 2
1 Solution
There's not a script that will do this automatically. I don't know that Access can do this.  
You might be able to link the PSQL table in Access then insert the data to PSQL.  
Another way would be to write an application that reads the images into a binary stream variable, then use a parameterized query to insert the record.  
Personally, I don't store images in the database.  I prefer to store a link to the physical file.  That way, I don't have the overhead of reading and writing the image data twice (once to/from disk for display and once to/from the database).  
TarasAuthor Commented:
I need to display these pictures on Cristal Report8 that does not support image path  for display of images on report. This capability is introduced with CR11 as I understand
My client has application that is running on  pervasiveSQL9.5 database and using Crystal report 8. Now he wants to put pictures of his product on report. I dont have access to application code just to report and database.
That is reason that I am looking in option to upload images in table and use image control on crystal report to show images for particular record-product.

Best suggestion I can give would be to write an application that reads the image from disk into a BinaryStream type variable (what you use depends on the programming language) and then issue an INSERT statement to insert the image into the PSQL database.  
Here's a link to some code:
It uses MS SQL Server but can be adapted to PSQL easily.
TarasAuthor Commented:
thanks a lot.
It is good approach I will look in it.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now