ORALCE中BLOB字段问题 在DELPHI +ORACLE 开发C/S时,如何插入含有BLOB字段的记录,又怎么读出BLOB记录,打印BLOB字段了??谢了!!!!!!等待中。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 主要是图片,怎么存入BLOB字段中,怎么读出,谢!@! 我用的是sql-server不知道合适不:图片保存进数据库表字段var bmp1: Tbitmap; stream1: TMemorystream;begin bmp1:= Tbitmap.Create; stream1 := TMemorystream.Create; bmp1.SaveToStream(stream1); TBlobField(adoquery1.Fields[0]).LoadFromStream(stream1);end 上面写差了一句,不好意思bmp1.LoadFromFile('E:\This Week\惠州无线资源管理项目\pictures\zuhezaixian2.bmp'); //存文件到SQL数据库 字段为image 类型var fs: TFileStream;begin if not FileExists(edtFileName.Text) then begin Application.MessageBox(PChar('找不到文件' + edtFileName.Text), '错误', MB_ICONERROR); Exit; end; fs := TFileStream.Create(edtFileName.Text, fmOpenRead); ADOTable1.Append; try fs.Position := 0; TBlobField(ADOTable1.FieldByName('document')).LoadFromStream(fs); ADOTable1.Post; finally fs.Free; end;end;***********************************************//显示var filename, dir: string;begin dir := ExtractFilePath(ParamStr(0)) + 'temp'; if not DirectoryExists(dir) then CreateDir(dir); try fileName := dir + '\temp' + ADOTable1.FieldByName('id').AsString + ADOTable1.FieldByName('ext').AsString; TBlobField(ADOTable1.FieldByName('document')).SaveToFile(fileName); ShellExecute(handle, 'Open', PChar(fileName), nil, nil, SW_NORMAL); finally end; 高手帮帮忙啊:如何把容器(比如panel)上的信息存成图片啊? 有分大家得 如何获得打印机状态?(急!在线!行的通就给分!) 事务问题!在线等待!!! 我明明初始化了,可编译器说我没有!!!!!!! 先求设计思路,我要做一个客户端监测服务器的程序,详情见内,分不够可以再加!!!! 请哪位帮助我写一个函数? 我想在程序中加载一个.cur光标文件! 简单!如何把一个COMBOBOX和LISTBOX中的数据全部取出来?谢谢! 图像存取 怎么知道代码是在delphi的那个版本下写的? 如何取得指定进程的exe文件的路径?
var
bmp1: Tbitmap;
stream1: TMemorystream;
begin
bmp1:= Tbitmap.Create;
stream1 := TMemorystream.Create;
bmp1.SaveToStream(stream1);
TBlobField(adoquery1.Fields[0]).LoadFromStream(stream1);
end
bmp1.LoadFromFile('E:\This Week\惠州无线资源管理项目\pictures\zuhezaixian2.bmp');
var
fs: TFileStream;
begin
if not FileExists(edtFileName.Text) then
begin
Application.MessageBox(PChar('找不到文件' + edtFileName.Text), '错误', MB_ICONERROR);
Exit;
end;
fs := TFileStream.Create(edtFileName.Text, fmOpenRead);
ADOTable1.Append;
try
fs.Position := 0;
TBlobField(ADOTable1.FieldByName('document')).LoadFromStream(fs);
ADOTable1.Post;
finally
fs.Free;
end;
end;
***********************************************
//显示
var filename, dir: string;
begin
dir := ExtractFilePath(ParamStr(0)) + 'temp';
if not DirectoryExists(dir) then
CreateDir(dir);
try
fileName := dir + '\temp' + ADOTable1.FieldByName('id').AsString
+ ADOTable1.FieldByName('ext').AsString;
TBlobField(ADOTable1.FieldByName('document')).SaveToFile(fileName);
ShellExecute(handle, 'Open', PChar(fileName), nil, nil, SW_NORMAL);
finally
end;