Solved

How I can store .html into FIREBIRD

Posted on 2004-04-26
11
491 Views
Last Modified: 2010-04-05
People
 I  need to  save HTML in database (FIREBIRD 1.5). But i'll like to save this pictures of type  BLOB.
I use Delphi7 + FireBird + components of Interbase Pallete.
Someone know how i can do it! What components to use ?

Thanks..

--Elielson
 
0
Comment
Question by:emaia
  • 6
  • 4
11 Comments
 
LVL 12

Expert Comment

by:Ivanov_G
Comment Utility

   use TADOBlobStream class
0
 
LVL 12

Expert Comment

by:esoftbg
Comment Utility
use
  BLOB SUB_TYPE 0 SEGMENT SIZE 80
this field type is for pictures: .bmp, .jpg ....
0
 
LVL 12

Expert Comment

by:esoftbg
Comment Utility
i guess you can use Jedi VCL components, especially TJvRichEditToHtml, but not sure because didn't use it or similar. It is placed on Jv Internet palette.
0
 

Author Comment

by:emaia
Comment Utility
Someone will can send code like exemple?

Thanks
0
 
LVL 12

Accepted Solution

by:
esoftbg earned 115 total points
Comment Utility
by the way I sent to you a full working example in
http://experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20947052.html
about Extract DML in Firebird1.5
Without reaction since 04/08/2004 ????
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:emaia
Comment Utility
Emil  
Sorry,  
I forgot of to answer your last message About DML Extract.  
What happened is that I needed only metada and I used the IBExpert tool.  
Thanks, you have been helping me a lot.  
I will like to use your code for backup in the future, this will be last part in my project and you will be receive your deserved points .  
I hope that you understands.  
 
I would like that you will receive the points in this question. My last points.  
Your code that you sent that  store ".jpg" works perfectly.  
And if you can help me with the problem to Insert HTML in DataBase.  
I will be thankful.  
Thanks, Emil.  
 
--Elielson
0
 
LVL 12

Expert Comment

by:esoftbg
Comment Utility
--Elielson,
I'll try to help you about the problem to Insert HTML in FireBird DataBase. I hope I'll do it successful, because I didn't do it  before... I guess it will spend some time....
emil
0
 
LVL 12

Expert Comment

by:esoftbg
Comment Utility
Sorry about my mistake above the FireBird field type:
>use
>  BLOB SUB_TYPE 0 SEGMENT SIZE 80
>this field type is for pictures: .bmp, .jpg ....
HTML file is a text file, so it is better to be stored into a:
  BLOB SUB_TYPE TEXT SEGMENT SIZE 80 CHARACTER SET WIN1252

About Delphi syntax:
You can use TIBSQL component if want to update an existing record (For insert a new record the way is similar):
var
  SL:     TStringList;
begin
  SL := TStringList.Create;
  try
    SL.LoadFromFile('C:\WEBSITES\MYSITE\index.html');
    ibSQL.SQL.Text := 'UPDATE ITEMS SET INFO=:PINFO WHERE ID=:PID';
    ibSQL.ParamByName('PID').AsString := IBTABLE_Items.FiledByName('ID').AsString;
    ibSQL.ParamByName('PINFO').AsString := SL.Text;
    ibSQL.ExecQuery;
  finally
    SL.Free;
  end;
end;

This is not tested. I hope it will work well....
0
 

Author Comment

by:emaia
Comment Utility
Emil,  
the code that you sent me works correctly.  
 
By the way, how I can show the html in the form or application. I want to restore the data from database and show in the form.  
What component I can use.  
 
Thanks one more time...  
 
--Elielson

0
 
LVL 12

Expert Comment

by:esoftbg
Comment Utility
I guess that for development of a web browser to display a .html, may be you can use TWebBrowser component from "Internet" palette of Delphi. I did not make a Web browser.
I have Jedi VCL components, there is a palette "Jv Internet" with 14 components. You may try them....
emil
0
 

Author Comment

by:emaia
Comment Utility
Emil,
I tried the TWebBrowser, but only work when I put the URL like
  WebBrowser.Navigate.('c:\Data\teste.html').

I will try the Jedi Componetes.

Thanks..

Elielson
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

744 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

16 Experts available now in Live!

Get 1:1 Help Now