pb组件有一个blog数据类型, delphi里面不能访问,谁有方法???
解决方案 »
- 写了word生成程序,机器以前装的是word2003,运行正常但装word2000后无法运行,帮我
- 有没有在一段时间内没有用电脑就自动锁定软件的控件?
- ×××××××××××怎样调出系统的音量控制??×××××××××
- [求助]如何设置代码编辑器的大小和位置?
- 怎么打印RichEdit,StringGrid等控件中的内容。
- 当关闭ADO,又打开时为什么会出现数据库找不到?
- 数据库编程&中文处理问题,小问题!
- 我想更换关键字的颜色怎么办?
- Delphi如何把文本文档中的数据放在tkbmmemtable中
- DBImage能否显示JPG数据图形?
- 开源邪说!盲目开源到底伤害着谁?(转)
- linzhengqun(风) 进来领分!!!!感谢(4)
procedure TDM.SetMsgIcon(const MsgType: string; Icon: TICON);
begin
if MsgType = '' then Exit;
try
try
with ADOQMsgICON do
begin
Close;
SQL.Text := 'Update MsgType Set Icon = :ICON Where InfoType = :InfoType';
Parameters.ParamByName('ICON').Assign(ICON);
Parameters.ParamByName('InfoType').Value := MsgType;
ExecSQL;
end;
except
raise;
end;
finally
ADOQMsgICON.Close;
end;
end;从数据库取出
function TDM.GetMsgIcon(const MsgType: string; ICON: TICON): Boolean;
var
ICONStream: TMemoryStream;
begin
Result := False;
if MsgType = '' then Exit;
ICONStream := TMemoryStream.Create;
try
try
with ADOQMsgICON do
begin
Close;
SQL.Text := 'Select ICON from MsgType Where InfoType = :InfoType';
Parameters.ParamByName('InfoType').Value := MsgType;
Open;
if RecordCount = 0 then
begin
Result := False;
end else
begin
TBlobField(FieldByName('Icon')).SaveToStream(ICONStream);
ICONStream.Position := 0;
if ICONStream.Size = 0 then
begin
Result := False;
end else
begin
Icon.LoadFromStream(ICONStream);
Result := True;
end;
end;
end;
except
raise;
end;
finally
ICONStream.Free;
ADOQMsgICON.Close;
end;
end;