Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Assigning data to a database memo field

Posted on 2002-07-15
4
Medium Priority
?
310 Views
Last Modified: 2010-04-04
An easy one for you (probably)!

When appending data from a screen form to a database I'm using syntax like

FieldByName('CallType').AsString := edtCallType.Text;

What's the corresponding syntax for a memo field?

I assumed it would be something like

FieldByName('Comments').AsMemo := mmComments.Lines;

but life isn't that simple...

Many thanks for your help
0
Comment
Question by:riccohb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7153917
just from head,
don't know if possible

TBlobField(FieldByName('Comments')).Text := mmComments.Lines;

or

TBlobField(FieldByName('Comments')).asText := mmComments.Lines;

or also

TBlobField(FieldByName('Comments')).asString := mmComments.Lines;

meikl ;-)
0
 

Author Comment

by:riccohb
ID: 7153941
Thanks for your help, but...

TBlobField(FieldByName('Comments')).Text := mmComments.Lines;

and

TBlobField(FieldByName('Comments')).asString := mmComments.Lines;

bring up the error 'Incompatible types: String and TStrings'

There's no such identifier as 'asText'.
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 200 total points
ID: 7153950
use
mmComments.text;

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7153954
if all fails

var
  m : tmemorystream;
begin
  m := tmemorystream.Create;
  try
    mmComments.Lines.SaveToStream(m);
    m.position := 0;
    TBlobField(FieldByName('Comments')).LoadFromStream(m);
  finally
    m.free;
  end;
end;

meikl ;-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

609 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