十分恳求 请问利用delphi怎样在sql server2000中实现对图片、声音和视频等多媒体文件的存储和调用? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用内存流的方法看一下这个例子http://expert.csdn.net/Expert/topic/2844/2844005.xml?temp=.3278467 用 BolbStream,名字可能有误。 可以保存任何文件jpeg,pdf,wav 等。delphi7+sql2000+win2000通过!unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, ADODB, StdCtrls, shellapi,Buttons;type TForm1 = class(TForm) OpenDialog1: TOpenDialog; BitBtn1: TBitBtn; BitBtn2: TBitBtn; ADOConnection1: TADOConnection; ADOQuery1: TADOQuery; procedure BitBtn1Click(Sender: TObject); procedure BitBtn2Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1; s:string;implementation{$R *.dfm}procedure TForm1.BitBtn1Click(Sender: TObject);begin if OpenDialog1.Execute then begin if not ADOQuery1.Active then ADOQuery1.Open; ADOQuery1.Append; s :=ExtractFileName(OpenDialog1.FileName); (ADOQuery1.FieldByName('doc') as TBlobField).LoadFromFile(OpenDialog1.filename); ADOQuery1.Post;end;end;procedure TForm1.BitBtn2Click(Sender: TObject); begin (ADOQuery1.FieldByName('doc') as TBlobField).savetoFile(ExtractFileDir(Application.ExeName)+s); shellexecute(handle,nil,pchar(s),nil,nil,sw_shownormal);end;end. sql2000中的数据'doc'格式为 image 格式。。 adoBS: TADOBlobStream;adoBS := TADOBlobStream.Create(Dset.Fields[nI] as TBlobField, bmRead);try adoBS.ReadBuffer(aMachFing[0], COLL_FINGER_DATA);finally adoBS.Free;end;如果是BDE的则用TBlobStream 具体可查帮助 ShellExecute 打开未关联文件出错 这splitter吗?? Delphi调用MS SQL Server的存储过程,在论坛里看了好些贴,也没有明白 做过IC卡读写和指纹识别的朋友请进来 请教高手,有没有矩阵求逆、相乘的算法呀? 两个菜的问题!!小女羞了!! 如何在DELPHI中写接口?? 紧急求救报表问题 请大家说说如何根据条件控制DBGRID单元格中的颜色! 怎样将倚天码的汉字转换成BIG5码或GB码?或有什么编辑软件可对倚天汉字进行编辑???? 告诉大家一个好网站. 简单的SQL??
delphi7+sql2000+win2000通过!unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, StdCtrls, shellapi,Buttons;type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
s:string;
implementation{$R *.dfm}procedure TForm1.BitBtn1Click(Sender: TObject);begin
if OpenDialog1.Execute then
begin
if not ADOQuery1.Active then ADOQuery1.Open;
ADOQuery1.Append;
s :=ExtractFileName(OpenDialog1.FileName);
(ADOQuery1.FieldByName('doc') as TBlobField).LoadFromFile(OpenDialog1.filename);
ADOQuery1.Post;end;
end;procedure TForm1.BitBtn2Click(Sender: TObject); begin
(ADOQuery1.FieldByName('doc') as TBlobField).savetoFile(ExtractFileDir(Application.ExeName)+s);
shellexecute(handle,nil,pchar(s),nil,nil,sw_shownormal);end;end.
as TBlobField, bmRead);
try
adoBS.ReadBuffer(aMachFing[0], COLL_FINGER_DATA);
finally
adoBS.Free;
end;如果是BDE的则用TBlobStream 具体可查帮助