Board index » delphi » Delphi accessing MS Access Memo Fields

Delphi accessing MS Access Memo Fields

Just a beginner trying to recreate an access program through Delphi,

I have managed to link Delphi to my existing MS Access 2000 database and
display a table with all the data, using ADO components.

I have found however that the existing MEMO field data does not get
displayed just the word "MEMO"?

Is there something that I have missed or is Delphi not able to display MEME
field information from access using ADO?

Thanks in advance

Andrew

 

Re:Delphi accessing MS Access Memo Fields


A TDBMemo component will display a memo field correctly if you set the
AutoDisplay property to True.
For a TDBGrid you will have to add an OnGetText event to the memo field,
e.g.

procedure TForm1.Table1MemoGetText(Sender: TField; var Text: String;
  DisplayText: Boolean);
begin
  Text := Sender.AsString;
end;

Quote
"Andrew" <Andrew.G...@dnr.qld.gov.au> wrote in message

news:uTJe7.46$bB5.10011@nsw.nnrp.telstra.net...
Quote
> Just a beginner trying to recreate an access program through Delphi,

> I have managed to link Delphi to my existing MS Access 2000 database and
> display a table with all the data, using ADO components.

> I have found however that the existing MEMO field data does not get
> displayed just the word "MEMO"?

> Is there something that I have missed or is Delphi not able to display
MEME
> field information from access using ADO?

> Thanks in advance

> Andrew

Re:Delphi accessing MS Access Memo Fields


Please ignore my stupidity, but I have only been using Delphi for a few
days, I had no problem with adding a "TDBMemo component" and getting this to
work, however trying to get the TDBGrid method to work has me stumped.

When selecting the TDBGrid, there is no "OnGetText event"  shown in the
Object Inspector "Events" list. I could not find this event when editing the
grids columns and selecting the Memo field that needs to be displayed
correctly.

I'm guessing that by looking at the procedure name
"TForm1.Table1MemoGetText" That there is meant to be a Table1 added to my
form, however I have only used
a TADOConnection, a TADODataSet, a TDataSource and a TDBGrid to display my
data.

Adding any of the different "Table Components" does not seem provide an
"OnGetText" event, or do much at all.

Any further help or clarification of the code you provided would be
appreciated.
Thanks for the help

Andrew

Quote
"M.H. Avegaart" <avega...@NOSPAMmccomm.nl> wrote in message

news:9lft01$12fp$1@scavenger.euro.net...
Quote
> A TDBMemo component will display a memo field correctly if you set the
> AutoDisplay property to True.
> For a TDBGrid you will have to add an OnGetText event to the memo field,
> e.g.

> procedure TForm1.Table1MemoGetText(Sender: TField; var Text: String;
>   DisplayText: Boolean);
> begin
>   Text := Sender.AsString;
> end;

Re:Delphi accessing MS Access Memo Fields


OnGetText is a TField event. Right-click on the TADODataSet and select Field
editor. If the field editor is empty you will first have to press Ctrl+A.
Now you can select the memo field and create an OnGetText event.

Quote
"Andrew" <Andrew.G...@dnr.qld.gov.au> wrote in message

news:6vZe7.3$2V5.1146@nsw.nnrp.telstra.net...
Quote
> Please ignore my stupidity, but I have only been using Delphi for a few
> days, I had no problem with adding a "TDBMemo component" and getting this
to
> work, however trying to get the TDBGrid method to work has me stumped.

> When selecting the TDBGrid, there is no "OnGetText event"  shown in the
> Object Inspector "Events" list. I could not find this event when editing
the
> grids columns and selecting the Memo field that needs to be displayed
> correctly.

> I'm guessing that by looking at the procedure name
> "TForm1.Table1MemoGetText" That there is meant to be a Table1 added to my
> form, however I have only used
> a TADOConnection, a TADODataSet, a TDataSource and a TDBGrid to display my
> data.

> Adding any of the different "Table Components" does not seem provide an
> "OnGetText" event, or do much at all.

> Any further help or clarification of the code you provided would be
> appreciated.
> Thanks for the help

> Andrew

> "M.H. Avegaart" <avega...@NOSPAMmccomm.nl> wrote in message
> news:9lft01$12fp$1@scavenger.euro.net...
> > A TDBMemo component will display a memo field correctly if you set the
> > AutoDisplay property to True.
> > For a TDBGrid you will have to add an OnGetText event to the memo field,
> > e.g.

> > procedure TForm1.Table1MemoGetText(Sender: TField; var Text: String;
> >   DisplayText: Boolean);
> > begin
> >   Text := Sender.AsString;
> > end;

Other Threads