Jump to content

limelect

Members
  • Content Count

    369
  • Joined

  • Last visited

Community Reputation

36 Excellent

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. limelect

    Document projects

    SORRYYYYYYYYYYYY redownload project I fix the directory left in dir
  2. limelect

    Document projects

    I did this program out of necessity I have hundreds of projects, big or small, that I needed to document. Some of you will not need this program some mite. It documents all the projects in a database. It started simple but got bigger and bigger. I am loading the help file if anyone wants to know more. the link http://limelect.com/downloads/document-projects/ there you will find a lot of goodies for free. I hope it is bug-free. But if need plz email me the comments. Thanks Document_Project.chm
  3. limelect

    Data Base does not save data

    Do not know why. It was easier on my head. No reason to be perfect. Looking at my source ProjectsFDTable.FieldByName('Description').AsString; has NO BLOB D10.2.3
  4. limelect

    Data Base does not save data

    @Lars Fosdal You did not read carefully the problem !!! since RTE file which at the end has 3 bytes 02 00 00 The database truncate !!! those bytes when using string You have to use a blob. You can reload the data a string which from which I use it as a stream s := ProjectsFDTable.FieldByName('Description').AsString; St := TStringStream.Create(S); It all comes to this component >>>> AdvRichEditor
  5. limelect

    Data Base does not save data

    @Lars Fosdal Thanks. All the source is in the question. I thought I was very clear with the problem. In any case, it took me a while but I fixed it. The answer is xxxx.SaveToStream(S); TBlobField(ProjectsFDTable.FieldByName('Description')).LoadFromStream(S); Thanks in any case
  6. limelect

    Data Base does not save data

    Thank you everybody for your kind help. Can someone open a site, not for novices? Even professionals need sometime help
  7. limelect

    Data Base does not save data

    I have an RTE file which at the end has 3 bytes 02 00 00 Using FDTable with SQLite FDConnection1.ExecSQL('CREATE TABLE IF NOT EXISTS Projects (MyDateTime DateTime,ProjectName TEXT,ProjectrealName TEXT,Category TEXT NULL,Description TEXT NULL,FilesIndex INTEGER)'); Description TEXT NULL =TEXT First, try ProjectsFDTable.FieldByName(',Description').AsString := MY RTE TEXT ProjectsFDTable.Post; ProjectsFDTable.Refresh; Last 3 bytes get deleted !!! Can I use it as a string????????? Second try as a BLOB Description BLOB NULL =BLOB var BlobField:TBlobField; Stream : TStream ; Stream := TStream.Create; <<<<<<<<< I do not free the stream BlobField := ProjectsFDTable.FieldByName('Description') as TBlobField; Stream := ProjectsFDTable.CreateBlobStream(BlobField, bmWrite); xxxx.SaveToStream(Stream); ProjectsFDTable.Post; ProjectsFDTable.Refresh; After Refresh I can see the stream has changed to the data size as needed. BUT NO DATA IN Description field !!!!! closing the application and looking at the database no description data. I did not manipulate the field let Delphi do the work
  8. limelect

    Saving tree to Data Base

    Thanks every one 30+ years of Delphi did not teach me everything
  9. limelect

    Saving tree to Data Base

    I did not understand blob as binary cant i put any format as strigns or else? strings in stream?
  10. limelect

    Saving tree to Data Base

    @Bill Meyer i used your link to develop my own as strings instead procedure SaveTreeviewToString(tv: TTreeview; Sl: TStringlist); var node: TTreeNode; s:string; begin Assert(Assigned(tv)); try node := tv.Items[0]; while node <> nil do if node.CheckState=csChecked then begin s:=''; s:=s+'#'+inttostr(node.level); s:=s+'#'+(node.Text); Sl.Add(s); node := node.GetNext; end; finally end; end; procedure LoadTreeviewFromFile(tv: TTreeview; Sl: TStringlist); var node: TTreeNode; level,i,x,x2: Integer; s,s1,s2:string; begin try tv.Items.Clear; try node := nil; for i:=0 to sl.Count-1 do begin s:=Sl; x:=PosEx('#',s,1); x2:=PosEx('#',s,x+1); s1:=copy(s,x+1,x2-(x+1)); s2:=copy(s,x2+1,length(s)); level := strtoint(s1); if node = nil then {create root node, ignore its level} node := tv.Items.Add(nil, '') else begin if level = node.level then node := tv.Items.Add(node, '') else if level > node.level then node := tv.Items.AddChild(node, '') else begin while Assigned(node) and (level < node.level) do node := node.Parent; node := tv.Items.Add(node, ''); end; end; node.Text := s2; end; finally end; finally end; end;
  11. limelect

    Saving tree to Data Base

    I wander no one is using FDTable with blobs? I used blob with other database components it works with no problem Is it me or Delphi vcl 10.2.3?
  12. limelect

    Saving tree to Data Base

    @Bill Meyer sorry save does not work procedure SaveTreeviewToStream(tv: TTreeview; S: TStream); 3 var 4 writer: TWriter; 5 node: TTreeNode; 6 begin 7 Assert(Assigned(tv)); 8 Assert(Assigned(S)); 9 writer := TWriter.Create(S, ); 10 try 11 node := tv.Items[]; 12 writer.WriteListBegin; 13 while node <> nil do 14 begin 15 writer.WriteInteger(node.level); 16 writer.WriteString(node.Text); 17 writer.WriteInteger(node.Imageindex); 18 writer.WriteInteger(Integer(node.data)); 19 node := node.GetNext; 20 end; 21 writer.WriteListEnd; 22 writer.FlushBuffer; 23 finally 24 writer.Free; 25 end; 26 end; 27 BlobField := FilesFDTable.FieldByName('Files') as TBlobField; FilesFDTable.Insert; Stream := FilesFDTable.CreateBlobStream(BlobField, bmWrite); SaveTreeviewToStream(tree,Stream); FilesFDTable.Post; FilesFDTable.Refresh; As for the reader it has a bug I am stack !!! any help ?
  13. limelect

    Saving tree to Data Base

    @Bill Meyer thanks i will try
  14. limelect

    Saving tree to Data Base

    I have done this many times. This time it does not work I have 2 components FDConnection1 and FilesFDTable (FDTable) >>> SQLite first, I do this >>> FDConnection1 active. procedure TForm1.FDConnection1AfterConnect(Sender: TObject); begin FDConnection1.ExecSQL('CREATE TABLE IF NOT EXISTS Files (SectionsId INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,Files BLOB NULL)'); FilesFDTable.TableName:='Files'; FilesFDTable.Active:=True; end; I put here all my tries too. Non worked I got NULL no save procedure TForm1.SaveTreeToBlob(Tree: TTreeView); var // MS: TMemoryStream; BlobField:TBlobField; Stream : TStream ; begin //MS := TMemoryStream.Create; BlobField := FilesFDTable.FieldByName('Files') as TBlobField; try // Tree.SaveToStream(MS); // MS.Position := 0; FilesFDTable.Insert; Stream := FilesFDTable.CreateBlobStream(BlobField, bmWrite); Tree.SaveToStream(Stream); // Stream.Write(ms,ms.Size); FilesFDTable.Post; FilesFDTable.Refresh; FilesFDTable.Close;// Active:=False; FilesFDTable.Active:=True; finally // MS.Free; // Stream.Free; end; end; No errors just output NULL or my DATABASE READER DOES NOT SEE THE BLOB?Thanks
  15. limelect

    Add 2 controls to same row coulomb gridpanel

    Thanks, you are right
×