如题:
请问你们有没有这方面的代码,感激不尽!!
我做了一个,运行时出现下面的提示:Project Project1.exe raised eception class EDBEngineError with message 'Insufficient memory for this operation.Alias'Process stopped!
我学习的不深,还请高手帮助!!!
请问你们有没有这方面的代码,感激不尽!!
我做了一个,运行时出现下面的提示:Project Project1.exe raised eception class EDBEngineError with message 'Insufficient memory for this operation.Alias'Process stopped!
我学习的不深,还请高手帮助!!!
解决方案 »
- c58342418..
- 济南下大雨了
- fastreport30主从表时,这么当每页主表最后一条记录时打印从表内容?
- 如何进行界面中英文转换的问题?(很愚蠢的问题)
- 简单问题EDIT哪一个属性是允许多行显示的哟
- imageen对黑白图片旋转怎么有黑边啊?
- Delphi新手提问,怎样编写Tstringgrid中某个单元格的ONENTER,ONEXIT事件?
- 请教各位大侠一个简单的问题!(在线等待)
- www.pcjingning.com的新消息:一个4M大的模拟触摸屏的源程序。欢迎下载!请提前以让更多的人看见,谢谢!
- DELPHI中如何调用SQL 的存储过程?请给个例子!谢了!
- 如何在一个工程里删除datamodule
- 招聘delphi软件工程师
在DELPHI中用内存流
TBLOB
在DELPHI中用内存流 var vsound :Tmemorystream ;
TBLOB
在用TQUERY TTABLE存取就行了。
万分感谢!!!1
”的对话框。问题怎么解决呢
procedure TForm3.FormCreate(Sender: TObject);
var
mem:TMemoryStream;
begin
if table1.Eof and table1.Bof then
begin
with table1 do
begin
Insert;
FieldByName('Name').AsString:='音乐';
mem:=TMemoryStream.Create();
mem.LoadFromFile('E:\第二学期\多媒体\作业\sound\music.WAV');
TBlobField(FieldByName('Data')).LoadFromStream(mem);
post;
mem.Free;
end;
end;
with table1 do
begin
First;
while not Eof do
begin
ListBox1.Items.Add(FieldByName('Name').AsString);
Next;
end;
end;
end;
procedure TForm3.ListBox1Click(Sender: TObject);
var
FileName:string;
FileStream:TFileStream;
BlobStream:TStream;
begin
with table1 do
begin
First;
while not Eof do
begin
if FieldByName('Name').AsString=ListBox1.Items[ListBox1.ItemIndex]
Then
break;
Next;
end;
//为字段创建BLOG数据流
BlobStream:=CreateBlobStream(FieldByName('Data'),bmRead);
if BlobStream.Size=0 Then
begin
BlobStream.free;
Exit;
end;
BlobStream.Position:=0;
FileName:='Sound.tmp';
if FileExists(FileName) Then
DeleteFile(FileName);
FileStream:=TFileStream.Create(FileName,fmcreate or fmopenwrite);
FileStream.CopyFrom(BlobStream,BlobStream.Size);
FileStream.Free;
FileStream.Free;
PlaySound(PChar(FileName),0,SND_FILENAME+SND_ASYNC);
if FileExists(FileName) Then
DeleteFile(FileName);
end;
end;