[Demo] DB Editor

Demos, code samples. Only questions related to the existing topics are allowed here.
Post Reply
Sergey Tkachenko
Site Admin
Posts: 17521
Joined: Sat Aug 27, 2005 10:28 am
Contact:

[Demo] DB Editor

Post by Sergey Tkachenko »

http://www.trichview.com/support/files/dbeditdemo.zip

This is an analog of the demo Demos\Delphi\Editors\Editor 2\, but with TDBRichViewEdit instead of TRichViewEdit.
This demo implements basic commands for changing text and paragraph attributes (without RichViewActions)

This ZIP file includes several versions of this demo:
  • BDE (Paradox table)
  • FireDAC (InterBase table)
  • ADO / dbGo (Microsoft Access 2010 table)
[+] Updates
2019-Jul-08: ADO with MS Access demo is added.
2018-Apr-16: in addition to BDE demo, I added FireDAC demo with InterBase table. The demo was created in Delphi 10.2, the table was created using InterBase 2017, but I hope they work in older versions of Delphi and InterBase too.
Nostradamus
Posts: 67
Joined: Sat May 13, 2006 1:56 pm
Location: Australia

Project does not compile in Delphi 2010

Post by Nostradamus »

Hi,

I could not get this DB project to compile on Delphi 2010.

Any help is appreciated

I have windows 7 - 64 bit

thanks and
Happy New Year

Richard[/img]
Sergey Tkachenko
Site Admin
Posts: 17521
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This demo uses BDE and Paradox table.
Probably, you did not install BDE support when installing Delphi.
Also, Win7 may have problems working with BDE (this demo works fine on Win8, though)

You can try using another DB engine - replace Table1: TTable to you favorite DB dataset components.
A table must have Document field able to store arbitrary binary data.
Nostradamus
Posts: 67
Joined: Sat May 13, 2006 1:56 pm
Location: Australia

project is working now...

Post by Nostradamus »

I tried the project again today and it works now.

Thanks

Serge

PS I am still using Windows 7
Sergey Tkachenko
Site Admin
Posts: 17521
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: [Demo] DB Editor

Post by Sergey Tkachenko »

FireDAC version of this demo is added (in the same ZIP file)
Nostradamus
Posts: 67
Joined: Sat May 13, 2006 1:56 pm
Location: Australia

Re: [Demo] DB Editor

Post by Nostradamus »

HI SERGEY,

I TRIED THE FIREDAC VERSION IT DOES NOT WORK WITH DELPHI 2010.

I USUALLY TEND TO USE ADO COMPONENTS WITH MS ACCESS AS THIS IS THE ONLY DATABASE .mdb THAT WORKS WITH OLE JET 4 DB PROVIDER
WHEN

BUILDING DATABASE CONNECTION.
Sergey Tkachenko
Site Admin
Posts: 17521
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: [Demo] DB Editor

Post by Sergey Tkachenko »

I'll try to make an example in the next couple of days.

The main problem with MS Access, as far as I understand, the lack of field type for storing arbitrary binary data (required for RVF).
Unfortunately, even "text mode" RVF is not really a plain text and requires a binary field.

Well, there is a solution: use a memo field and encode RVF in a text string (using a hexadecimal code or base64). I'll implement it in the demo.
Sergey Tkachenko
Site Admin
Posts: 17521
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: [Demo] DB Editor

Post by Sergey Tkachenko »

I added ADO+Access version of this demo.

As I said above, the main difficulty was storing binary RVF data in a text (memo) field.

I used the simplest possible binary-to-text encoding - hexadecimal code. It is simple and fast, but increases data size by 100%.

A better alternative would be Base64 encoding, it increases data size only by 33%.
Unfortunately, base64 functions were included in Delphi only since XE7, and you need Delphi 2010 version. You can use DIMime for base64 encoding.
Nostradamus
Posts: 67
Joined: Sat May 13, 2006 1:56 pm
Location: Australia

Re: [Demo] DB Editor

Post by Nostradamus »

Hi Sergey,
I am trying to get back into things while I still have some free time...
in this project you mention a datafile... 'DemoData.ib'
Can I have a copy of this file ?

Thanks
Richard


procedure TForm1.FormCreate(Sender: TObject);
begin
// Filling font names combobox
cmbFont.Items.Assign(Screen.Fonts);
// Opening table
with FDConnection1.Params do
begin
Clear;
Add('DriverID=IB');
Add('Database=localhost:' + ExtractFilePath(Application.ExeName) + 'DemoData.ib');
Add('User_Name=SYSDBA');
Add('Password=masterkey');
end;
FDConnection1.Connected := True;
FDTable1.Open('');
end;
Sergey Tkachenko
Site Admin
Posts: 17521
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: [Demo] DB Editor

Post by Sergey Tkachenko »

DemoData.ib is included
Nostradamus
Posts: 67
Joined: Sat May 13, 2006 1:56 pm
Location: Australia

Re: [Demo] DB Editor

Post by Nostradamus »

OK My error... I forgot to install RAD SERVER

still get error message though...

DBEditl: Field Title' not found.

see attached error message also.
cheers
Richard
Attachments
DB_Editor demo_error_message.png
DB_Editor demo_error_message.png (55.92 KiB) Viewed 70086 times
Nostradamus
Posts: 67
Joined: Sat May 13, 2006 1:56 pm
Location: Australia

Re: [Demo] DB Editor

Post by Nostradamus »

I finally got the FireDC_IB project working today

Merry Xmas
Post Reply