Access中的表为:no,name,sex,photo,re等
源代码:
var
MS:TMemoryStream;
begin
opendialog1.Filter:='图形文件(*.bmp)|*.bmp';
MS:=TMemoryStream.Create;
if OpenDialog1.Execute then
DBImage1.Picture.LoadFromFile(opendialog1.FileName);
DBImage1.Picture.Bitmap.SaveToStream(MS);
MS.Position:=0;
TBlobField(adotable1.FieldByName('photo')).LoadFromStream(MS);
adotable1.Post;
end;
出现的错误:
project MainForm.exe raised exception class EDatabaseError with message'ADOTable1:Dataset not in edit or insert mode',Process steopped,Use Step or Run to continue
源代码:
var
MS:TMemoryStream;
begin
opendialog1.Filter:='图形文件(*.bmp)|*.bmp';
MS:=TMemoryStream.Create;
if OpenDialog1.Execute then
DBImage1.Picture.LoadFromFile(opendialog1.FileName);
DBImage1.Picture.Bitmap.SaveToStream(MS);
MS.Position:=0;
TBlobField(adotable1.FieldByName('photo')).LoadFromStream(MS);
adotable1.Post;
end;
出现的错误:
project MainForm.exe raised exception class EDatabaseError with message'ADOTable1:Dataset not in edit or insert mode',Process steopped,Use Step or Run to continue
解决方案 »
- delphi opendialog 打开多个文件顺序
- 怎样得到上个月今天的日期
- postmessage向别的应用程序发送键盘消息失败?
- 如何利用钩子知道[QQ聊天窗口]弹了出来并得到其句柄?
- ListView、TreeView 图标 叠加的问题有点难!
- 请教 IntraWeb中的TMS的DBAdvWebGrid如何用ctNode实现明细行
- 为什么www.delphibbs.com 一发粘就出错??
- 求助,Delphi的错误
- 关于U盘的一个编程
- 怎么用borland的开发工具做出来的软件老有问题
- 怎样在表中填入空字符串?A字段为字符串型,原值为'Y',怎样将它改为''(空字符串)呢?
- 关于tdblistbox、tdbcombobox等控件的菜鸟级问题:(
MS:TMemoryStream;
begin
ADOTable1.Active:=true;
ADOTable1.Insert;
opendialog1.Filter:='ͼÐÎÎļþ(*.bmp)|*.bmp';
MS:=TMemoryStream.Create;
if OpenDialog1.Execute then
DBImage1.Picture.LoadFromFile(opendialog1.FileName);
DBImage1.Picture.Bitmap.SaveToStream(MS);
MS.Position:=0;
TBlobField(adotable1.FieldByName('photo')).LoadFromStream(MS);
adotable1.Post;
end;
Edit or Insert.----------------
沉沦中..........