捐赠 | 广告 | 注册 | 发布 | 上传 | 关于我们    
  粤ICP备10103342号-1 DELPHI盒子 | 盒子文章 | 盒子问答悬赏 | 最新更新 | 盒子检索 | 下载中心 | 高级搜索    
  精品专区 | 繁體中文 | 奖励公告栏 | 直通车账号登陆 | 关闭GOOGLE广告 | 临时留言    
盒子资源分类
全部展开 - 全部合拢
TWideMemoField,Unicode的Memo字段
关键字:TWideMemoField widestring unicode
来 自:原创
平 台:Win9x,Win2k/XP/NT,Win2003 下载所需:0 火柴
深浅度:中级 完成时间:2005/10/29
发布者:sspeak 发布时间:2005/10/29
编辑器:DELPHI7 语  种:简体中文
分 类:数据库 下载浏览:0/6036
加入到我的收藏
下载错误报错
登陆以后才能下载
 用户名:
 密 码:
自动登陆(30天有效)
无图片
TWideMemoField,Unicode的Memo字段,使用非常简单,如:
TWideMemoField(FieldByName('name')).AsWideString:=....

源码:

unit MyWideMemoField;

interface

uses
  Classes,
  Windows,
  DB;

type
  TWideMemoField = class(TBlobField)
  private
    function GetAsWideString: WideString;
    procedure SetAsWideString(const Value: WideString);
  public
    property AsWideString: WideString read GetAsWideString write SetAsWideString;
  end;

implementation

{ TWideMemoField }

function TWideMemoField.GetAsWideString: WideString;
var
 Len:Integer;
begin
  with DataSet.CreateBlobStream(Self, bmRead) do
  try
    Len := Size div 2;
    SetLength(Result, Len);
    if Length(Result) > 0 then
      ReadBuffer(PWideChar(Result)^, Size);
  finally
    Free;
  end;
end;

procedure TWideMemoField.SetAsWideString(const Value: WideString);
begin
  with DataSet.CreateBlobStream(Self, bmWrite) do
  try
    WriteBuffer(PWideChar(Value)^, Length(Value) * 2);
  finally
    Free;
  end;
end;

end.
Google
 
本站原创作品,未经作者许可,严禁任何方式转载;转载作品,如果侵犯了您的权益,请联系我们
龙脉加密锁 15元起 Grid++Report 报表 申请支付@网
 相关文章
没有相关文章
相关评论
共有评论0条
我要发表评论 查看全部评论
 
  DELPHI盒子版权所有 技术支持:深圳市麟瑞科技有限公司 1999-2024 V4.01 粤ICP备10103342号-1 更新RSS列表