AArhin / sv-utils

Automatically exported from code.google.com/p/sv-utils

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow customization of FieldDefs!

GoogleCodeExporter opened this issue · comments

Reproduce bug:
var
  AFieldDef: TFieldDef;
  //DataSet: TSQLiteDataset;
begin
...
  AFieldDef := DataSet.FieldDefs.AddFieldDef;
  AFieldDef.FieldNo := 0;
  AFieldDef.Name := 'CMD_';
  AFieldDef.DataType := ftWideString;
  AFieldDef.Size := 255;
  DataSet.Open;
//DataSet.FieldByName('CMD_').Size = 50; !!!
end;


Please use this code to allow customization of FieldDefs:

function TSQLiteDataset.DoInitFields(AStmt: TSQLitePreparedStatement): 
TSQLiteUniTable;
... 
    //define DS
//    FieldDefs.Clear; //remove
    for i := 0 to Result.FieldCount - 1 do
      if FieldDefs.IndexOf(Result.Fields[i].Name) < 0 then
...

Original issue reported on code.google.com by xva...@gmail.com on 26 Jun 2013 at 5:33

This issue was closed by revision r167.

Original comment by lnaginio...@gmail.com on 27 Jun 2013 at 9:40

  • Changed state: Fixed