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;
  • 相关阅读:
    卡特兰数
    混合运算改进(代码)
    典型用户和场景
    混合运算
    四则运算
    计算
    感想
    git
    附加导航 affix,side--toolbar(可结合博客园使用~)
    对python-rrdtool模块的浅研究。
  • 原文地址:https://www.cnblogs.com/Thenext/p/12889152.html
Copyright © 2011-2022 走看看