Upload image in pervasive database table

Posted on 2009-04-28
Last Modified: 2012-05-06
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?
Question by:Taras
    LVL 18

    Expert Comment

    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).  

    Author Comment

    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.

    LVL 18

    Accepted Solution

    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.

    Author Closing Comment

    thanks a lot.
    It is good approach I will look in it.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now