Link to home
Start Free TrialLog in
Avatar of newbuilder
newbuilder

asked on

Insert picture in Database

1- How can I store the images in databases, I use Oralce, Blob datatype. when I call LoadFromFile a message "can not open file" appears. the SetBlobData and GetBlobData a message "unablecable operation" appears.

2- Does the ADO supports Blob datatypes?

if the answer works I will increase the points to 150 points
ASKER CERTIFIED SOLUTION
Avatar of Epsylon
Epsylon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mohammed Nasman
Hello

  you need to use stream to save and restore the image in Blob fields, I did this by using stream, but u can't do that with loadfromfile
   
  here's a good article to help you in that, using ADO with access database

Pictures inside a database
http://delphi.about.com/compute/delphi/library/weekly/aa030601a.htm

also I asked a question about that to store images in oracle database
https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=delphi&qid=20121415

Best regards
Mohammed Nasman

Avatar of Epsylon
Epsylon

This also works for ADO...
Avatar of newbuilder

ASKER

Thank you Epsylon.

When I use TADOTable an error appear  "Data type not supported"
newbuilder, I have this problem with oracle database when i use ado with blob field, it's work fine with me with access blob field using ado, I changed my program from ado to use BDE with oracle

so I did
mnasman
I have still some problems with the processing images in data base.
I feel the components is not stable. and I do not trust in BDE, so I went to the oracle database documentation, they solve the problem directly. I have oracle 8.0.6 the free version in oracle side. If you use Bfile (it likes blob) you can get the data from the disk and then convert and copy it to blob field.
Oracle documentation explains this method. In my opinion this method is the best. You will find the method in
\orant\doc\index.htm
You are better off just storing the path to the image in a varchar field and adjusting the properties on which ever display component you are using at runtime. Storing images in the DB itself is a resource/performance disaster. JMHO
didn't have any problem storing blob field via bde into an oracle-database
from 7.3 to 8.1.7 with epsylons provided code, up to blobs > 20MB

be sure you've the latest bde and the bugfixed sql-link

could be found at www.borland.com/devsupport/bde

meikl ;-)
kretzschmar, BDE working fine with Oracle Blob field, but the problem with ADO and Oracle Blob field

:-) ado is microsoft and will work properly with microsoft products, but may have problems with not microsoft products, as seen

i personell like to use doa from
http://www.allroundautomations.nl/doa.html
(comercial)
for work with oracle
(no ado or bde overhead and also no problems and faster than both)

meikl ;-)
Epsylon
I give you the points.
I found your code in the help. But I do not like the BDE.

Thank you for all