zoukankan      html  css  js  c++  java
  • 内容为null时通过synDBDataSet读出字段类型为wideMemo


    //MSSQL表中的字段是nvarchar格式,内容为null时通过synDBDataSet读出字段类型为wideMemo,将synDBVCL.pas单元procedure TSynBinaryDataSet.InternalInitFieldDefs按下面的方法修改就可以。

    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
    SynTable.ftInt64: DBType := ftLargeint;
    SynTable.ftDate: DBType := ftDateTime;
    SynTable.ftUTF8:
    if ColumnDataSize=0 then
    DBType := ftWideString else //ftDefaultMemo else
    DBType := ftWideString; // means UnicodeString for Delphi 2009+
    SynTable.ftBlob: DBType := ftBlob;
    SynTable.ftDouble, SynTable.ftCurrency: DBType := ftFloat;
    else raise EDatabaseError.CreateFmt(
    'GetFieldData ColumnType=%s',[TSQLDBFieldTypeToString(ColumnType)]);
    end;
    FieldDefs.Add(UTF8ToString(ColumnName),DBType,ColumnDataSize);
    end;
    end;
  • 相关阅读:
    linux压缩与解压
    simple 单例
    模板字符串
    变量的解构赋值
    let和const关键字
    React的基本认识
    Docker安装Nginx
    jenkins创建工程
    Jenkins系统初始化配置
    在CentOS上使用Docker镜像安装Jenkins
  • 原文地址:https://www.cnblogs.com/Thenext/p/12889152.html
Copyright © 2011-2022 走看看