procedure TForm1.Button1Click(Sender: TObject);
var
tmpStream:TMemoryStream;begin
OpenPictureDialog1.Filter:='bitmap files(*.bmp)|*.bmp';
if OpenPictureDialog1.Execute then
begin
Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
end; tmpStream := TMemoryStream.Create; try if Image1.Picture.bitmap <> nil then
Image1.Picture.Bitmap.SaveToStream(tmpStream);
adoquery1.Close;
adoquery1.SQL.Clear;
adoQuery1.SQL.Add('insert into tp表(picture).values ('':picture'')'); // 进行插入操作 adoQuery1.SQL.Add(' Where (tp_ID=:ltpid)');
adoQuery1.Parameters.ParamByName('picture').LoadFromStream(tmpStream,ftBlob); // 读取保存的内存图
adoQuery1.Parameters.ParamByName('ltpid').Value:=12; adoquery1.ExecSQL; finally
tmpStream.Free;
end;end;在运行的时候没有问题,在找到图片,点击打开的时候就出现"adoquery1 :parameter 'picture'not fount" 请问这是什么问题? 在数据库中有这个字段的。
var
tmpStream:TMemoryStream;begin
OpenPictureDialog1.Filter:='bitmap files(*.bmp)|*.bmp';
if OpenPictureDialog1.Execute then
begin
Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
end; tmpStream := TMemoryStream.Create; try if Image1.Picture.bitmap <> nil then
Image1.Picture.Bitmap.SaveToStream(tmpStream);
adoquery1.Close;
adoquery1.SQL.Clear;
adoQuery1.SQL.Add('insert into tp表(picture).values ('':picture'')'); // 进行插入操作 adoQuery1.SQL.Add(' Where (tp_ID=:ltpid)');
adoQuery1.Parameters.ParamByName('picture').LoadFromStream(tmpStream,ftBlob); // 读取保存的内存图
adoQuery1.Parameters.ParamByName('ltpid').Value:=12; adoquery1.ExecSQL; finally
tmpStream.Free;
end;end;在运行的时候没有问题,在找到图片,点击打开的时候就出现"adoquery1 :parameter 'picture'not fount" 请问这是什么问题? 在数据库中有这个字段的。
解决方案 »
- 我把源程序拷贝到别的电脑上 ,image原来带的图片都丢失了,
- 获取excel指定单元格的语句怎么写?!在线等!
- 怎样设置combobox的下拉框显示完整文字?
- 如何判断两个IP地址是否在同一网段?
- 系统上装有Delphi,在IE6出错时会自动跳出Delphi调试,能不能禁止调试啊??
- Access的表统计?
- TDateTime类型怎么进行加减运算?比如我要在当前的日期时间上再加30分钟,得到一个新的日期时间,应该怎么运算?
- 你对自己记忆力有过关注吗?-------程序员记忆力大调查!
- 不小心在paradox数据库中把date型的数据定义成了alpha型,在比较时出了问题,求助
- 关于HID读取长数据的问题
- 如何使用本地缓存
- 请帮忙查看这段代码,readfile和writefile应如何使用?(*)(*)
from tp表这是单独的一个表,
你是说” adoQuery1.SQL.Add('insert into tp表(picture).values ('':picture'')'); “
这句有问题?
------------------------------------------------
应该是:'insert into tp表 (picture) values ('':picture'')'
运行就出现错误
我这样修改了
insert into tp表(picture).values (''&picture&'')运行可以
还是出现相同的错误。