How to add multiple rows from TMemo component to MS Access database?

I got an ADO database with a table named t_codemeaning

, below is the table structure:

t_codemeaning
  codemenaing_code AS Text
  codemenaing_title AS Text
  codemenaing_description AS Text

      

I add the entire table to mine ADOQuery1

.

I click a button with this Delphi script:

ADOQuery1.edit;
ADOQuery1codemeaning_title.value := edit1.text;  
ADOQuery1codemeaning_description.value := memo1.lines.text;  
ADOQuery1.post;

      

When I add a separate line to the memo, then everything is fine.

But when I add a lot of multi-line line to memo1 it shows me an error:

Errors with multiple steps. Check each status value.

How to fix it?


My last progress, I created a new string variable aValue and add memo1.lines.text to it:

  aValue:=memo1.lines.text;
  aValue := StringReplace(StringReplace(aValue, '#10', '', [rfReplaceAll]), '#13', '', [rfReplaceAll]);

      

And I change the script for ADOQuery1codemeaning_description.value .... to:

ADOQuery1codemeaning_description.value := aValue;  

      

there was still the same error ...

+3


source to share


1 answer


Identify the field description

like Memo

in the database (instead Text

), and then delete all persistent fields of the ADOQuery1

and add them again to type ADOQuery1codemeaning_description

was ftMemo

,



No need to run or replace CRLF

.

+9


source







All Articles