Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Saving Images to SQL Server using BDE.

Posted on 2004-08-02
5
Medium Priority
?
251 Views
Last Modified: 2013-11-23
Hi
I'm trying to save an picture to an SQL Server database from delphi using a BDE TTable component to connect to the database, and a TDBImage to view the image.

When i add the database filed to the fields editor for the TTable it appears as a TBlobField with the Blobtype set as ftBlob, i have changed this to a ftGraphic and still get the following error.

when i save to the database i get the following error:
'Invalid Blob Length'


Cheers
0
Comment
Question by:scotdance
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 400 total points
ID: 11694752
keep it as ftBlob, ftgraphic requires a prefix before its content

a TDBImage can only display basic image-formats (no jpg for ex.)

you may take a look to this q
http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_11565459.html

meikl ;-)

0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 11695307
I thought a DBImage could display other graphic formats, as long as these formats were registered within Delphi? I might be mistaken, though.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 11695652
>I thought a DBImage could display other graphic formats
sure it can, but it cannot determine what graphic is to display.
usual it is bound on a ftGraphic-type. this type is delphi specific
and uses a longint-prefix (four bytes) for identifying the graphic-type
(this is based on d5, maybe d7 supports jpg also)

meikl ;-)
0
 

Author Comment

by:scotdance
ID: 11808317
sorry about the delay in getting back to you about this, it was put on a back burner while i worked on some other stuff.

and now the client has changed what they want too, isn't that what always happens, lol

They now want me to copy images from one database to another, the program has to
be able to go both ways
I.e. from MS SQL Server to Paradox, SQL to SQL, Paradox to SQL and Paradox to Paradox.
I can get it to copy most of the pictures but when I go from Paradox to SQLServer I get an error saying ' Invalid BLOB
Length  '.  
The image type that I use is a JPEG image, but I also get this error with BMP files too.

Anyone got any suggesting on how to fix this problem.

Thanks
0
 

Author Comment

by:scotdance
ID: 11830382
Thanks for the help folks, don't need to answer anything about the copying of images as i managed to get this to work.

Thanks again
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

596 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