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;
  • 相关阅读:
    指针+[][]T 类型
    linux适用小工具-tmux
    wrk+lua进行压力测试
    brew更换为国内源
    k8s证书更新
    ssh隧道
    kubeadm安装集群系列(kubeadm 1.15.1)
    harbor清理存储
    第十周课程总结
    第九周课程总结&第七次实验报告
  • 原文地址:https://www.cnblogs.com/Thenext/p/12889152.html
Copyright © 2011-2022 走看看