Thread: Dataset.post

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    7
    Rep Power
    0

    Dataset.post


    Hi,
    I have a dataset which reads the data from TMemo.lines. I wanted it to be saved back to the data base. I use the below code to do it. I did not get any error message but the data from the Tmemo is not getting saved to DB. Please help to fix this.
    MEMO has line like :
    XXX
    YYY
    ZZZ

    I use the below code to write the data back to DB.
    dmMain.dsetTemplates.EnableControls;
    dmMain.dsetTemplates.Edit;
    dmMain.dsetTemplates.FieldByName('TEMPLATE_BLOB').AsString := Memo1.Lines.Text;
    dmMain.dsetTemplates.Post;

    This code gets executed fine but when i check the database i do not have XXX YYY ZZZ updated back to DB
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    5
    Rep Power
    0

    database memo


    Hi I want to transfer the database memo...



    procedure TForm11.Button1Click(Sender: TObject);
    var
    i:integer;
    begin
    for i:=0 to memo1.lines.count - 1 do
    Begin
    Form1.YayinTanitimADOQuery1.insert;
    Form1.YayinTanitimADOQuery1.FieldByName('PROGRAMADI').AsString:= memo1.lines[i];
    Form1.YayinTanitimADOQuery1.post;
    end;
    end;
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    155
    Rep Power
    3
    Originally Posted by Lapni
    Hi,
    I have a dataset which reads the data from TMemo.lines. I wanted it to be saved back to the data base. I use the below code to do it. I did not get any error message but the data from the Tmemo is not getting saved to DB. Please help to fix this.
    MEMO has line like :
    XXX
    YYY
    ZZZ

    I use the below code to write the data back to DB.
    dmMain.dsetTemplates.EnableControls;
    dmMain.dsetTemplates.Edit;
    dmMain.dsetTemplates.FieldByName('TEMPLATE_BLOB').AsString := Memo1.Lines.Text;
    dmMain.dsetTemplates.Post;

    This code gets executed fine but when i check the database i do not have XXX YYY ZZZ updated back to DB
    I believe that TEMPLATE_BLOB field is a BLOB field. If that is really the case, you should use TBlobStream to put your data to that field.

    See my tutorial to see how to work with TBlobStream to store and retrieve Blob data from database.
    Last edited by Luthfi; June 28th, 2013 at 09:37 AM.

IMN logo majestic logo threadwatch logo seochat tools logo