Solved

How I can store .html into FIREBIRD

Posted on 2004-04-26
11
495 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
ID: 10920801

   use TADOBlobStream class
0
 
LVL 12

Expert Comment

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

Expert Comment

by:esoftbg
ID: 10921015
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
ID: 10921083
Someone will can send code like exemple?

Thanks
0
 
LVL 12

Accepted Solution

by:
esoftbg earned 115 total points
ID: 10921186
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:emaia
ID: 10921588
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
ID: 10921694
--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
ID: 10946356
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
ID: 10953493
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
ID: 10957531
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
ID: 10967715
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

914 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

20 Experts available now in Live!

Get 1:1 Help Now