• mORMot使用synDBDataSet时字段类型不正确引起的问题


    当SQL表中的nvarchar字段类型内容为null时synDBDataSet使用ftwideMemo类型造成不能修改的问题,按下面红字修改synDBVCL.pas就可以:

    synDBVCL.pas

    procedure TSynBinaryDataSet.InternalInitFieldDefs;
    var F: integer;
        DBType: TFieldType;
    begin
      FieldDefs.Clear;
      if fDataAccess=nil then
        exit;
      for F := 0 to fDataAccess.ColumnCount-1 do
        with fDataAccess.Columns[F] do begin
        case ColumnType of
        SynCommons.ftInt64: DBType := ftLargeint;
        SynCommons.ftDate:  DBType := ftDateTime;
        SynCommons.ftUTF8:
           DBType := ftWideString; // means UnicodeString for Delphi 2009+
        SynCommons.ftBlob:  DBType := ftBlob;
        SynCommons.ftDouble, SynCommons.ftCurrency: DBType := ftFloat;
        else raise EDatabaseError.CreateFmt(
          'GetFieldData ColumnType=%s',[TSQLDBFieldTypeToString(ColumnType)]);
        end;
        FieldDefs.Add(UTF8ToString(ColumnName),DBType,ColumnDataSize);
      end;
    end;

  • 相关阅读:
    修改tomcat访问路径
    HTML img标签属性
    HTML marquee标签属性详解
    HTML input标签
    HTML iframe 标签
    Linux root默认密码问题
    [Linux]查看本机IP
    [Linux]命令行模式切换
    [Linux]命令root与other切换
    [Linux]XAMPP安装
  • 原文地址:https://www.cnblogs.com/qiufeng2014/p/9147159.html
Copyright © 2020-2023  润新知