AllExperts > Delphi 
Search      
Delphi
Volunteer
Answers to thousands of questions
 Home · More Delphi Questions · Answer Library  · Encyclopedia ·
More Delphi Answers
Question Library

Ask a question about Delphi
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Krisztián Pintér
Expertise
I`m good at database design and programming, using windows API, multithreaded programming, inter-process commucitations, dll-s and packages. I`m experienced with OLAP and SQL. I also have some COM/ActiveX knowledge and component writing skills. Weak sides: internet, multimedia, graphics. Please don`t ask questions that can be easily looked up in the reference manual, or requires hours of debugging, what appears to be your task. Conceptional or methodological questions are the most welcome ones.

Experience
I have 8+ years work experience with Delphi. My primary area is Information Systems Programming. With a small team, we designed and implemented large scale Information Systems to pharmaceutical factories and parking companies.
 
   

You are here:  Experts > Computing/Technology > Delphi Programming > Delphi > Save Jpeg to MS SQl Server 2000

Delphi - Save Jpeg to MS SQl Server 2000


Expert: Krisztián Pintér - 11/5/2009

Question
i want Save/load Jpeg image to/from MS SQl Server 2000 in/from a table From Delphi 10(2005)
by coding and only SQL (TableName:MYTable FieldName:MyImage)
1- Whouldyou plz write me Who I can do it by ADOCommand
i dont want use TBlobField

Answer
hello,

what is the reason behind "don't want to use blob field"? it is some personal taste, or you have a rationale? because TBlobFields are the standard way of dealing with binary or blob database types.

what other options you have? when you save to the database, you can of course use simple SQL statements, assembled at runtime, without parameters. i don't know MySQL syntax, but for example in Sybase, you can write:

insert into MyTable (..., MyImage, ...)
 values (..., 0x5F6600007e01..., ...)

it will be a loooong hexadecimal code there, but if you don't run into some limitations of the statement size, it should work.

retrieving such a value is harder. if you have some function that converts blobs to hexadecimal strings, you can later transform it back to binary data with delphi code. but it seems an extremely roundabout and dirty way to go.

maybe if you tell me what is your actual goal, and why blob fields are to be avoided, i can tell you some better approach than the above ones.

regards,
K

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.