trichview.com

trichview.support




Saving imported text to DB Field


Return to index


Author

Message

Bob Dalton

Posted: 02/15/2002 1:19:26


I am attempting to import a text file into to a RTF bolob field using your

DB RichViewEdit component.


Here is the code I am using for the import:


procedure TScriptsInfoForm1.SpeedButton3Click(Sender: TObject);

var

  F: TextFile;

  S: string;

begin

  OpenDialog1.InitialDir :=

IncludeTrailingBackSlash(ExtractFilePath(paramstr(0))) + 'scripts';

  if OpenDialog1.Execute then { Display Open dialog box }

  begin

    try

      AssignFile(F, OpenDialog1.FileName);

      Reset(F);

      while not EOF(F) do

      begin

        Readln(F, S);

        rve.AddNL(S, 0, 0);

      end;

      CloseFile(F);

    finally

      rve.Format;

    end;

  end;

end;


This imports text successfully from a standard text file into the DB

RichViewEdit component which I have prepared by using a table field "clear"

statement prior to the import. The problem is that although I can view the

text in the DBRichViewEdit component with no problems when I hit the "Post"

button on the navigator toolbar all the text disappears from view and

nothing is saved to the database table field. Am I missing something here?


Regards;


Bob Dalton





Powered by ABC Amber Outlook Express Converter