Board index » delphi » Transferring data from database fields to other components.

Transferring data from database fields to other components.

I tried (for hours) to transfer a string from a
TStringfield in a database table to
a TRichEdit component using the statement:

AbsRichEdit.Text := DataModule1.SampleTableMonth.Value;

and variations thereon.  Each time I got the error:

EAccessViolation with message 'Access violation at address ...'

Q1.  What is the correct way to access data in database fields?

 

Re:Transferring data from database fields to other components.


Maybe . the below code would do it :

Component.Text := DataModule1.DataSet1['FieldName'].asString;

Quote
David Whitmire <dwhitm...@tntech.edu> wrote in message

news:88a1fg$inn8@bornews.borland.com...
Quote
> I tried (for hours) to transfer a string from a
> TStringfield in a database table to
> a TRichEdit component using the statement:

> AbsRichEdit.Text := DataModule1.SampleTableMonth.Value;

> and variations thereon.  Each time I got the error:

> EAccessViolation with message 'Access violation at address ...'

> Q1.  What is the correct way to access data in database fields?

Re:Transferring data from database fields to other components.


Maybe. the below code can do it:
AbsRichEdit.Text := DataModule.DataSet['FieldName'].AsString; <or>

Quote
David Whitmire <dwhitm...@tntech.edu> wrote in message

news:88a1fg$inn8@bornews.borland.com...
Quote
> I tried (for hours) to transfer a string from a
> TStringfield in a database table to
> a TRichEdit component using the statement:

> AbsRichEdit.Text := DataModule1.SampleTableMonth.Value;

> and variations thereon.  Each time I got the error:

> EAccessViolation with message 'Access violation at address ...'

> Q1.  What is the correct way to access data in database fields?

Other Threads