注册 登录
编程论坛 Delphi论坛

请教一个存储过程关于image问题?

missking 发布于 2006-04-12 11:13, 759 次点击

请教各位,用adostoredproc调用存储过程
try
with datamoduleado.ADOStoredProc1 do
begin
close;
procedurename:='Insert_ReadersInfo';
parameters.Clear ;
// parameters.CreateParameter('@RPhoto',ftimage,pdinput,16,0);
// parameters.ParamByName('@RPhoto').Value :=RPhotoImage.Transparent ;
prepared;
execproc;
end;
except
begin
messagedlg('数据添加失败',mterror,[mbok],0);
exit;
end;
close;
end;
//标有注释的两句出错了,请问用adostoredproc调用存储过程时image控件语法是如何的?标有注释的两行出错了,请教哪位高手能帮帮我

4 回复
#2
missking2006-04-12 11:19

怎么都没人理我,好伤心哦

#3
tendzzss2006-04-12 22:13

我想帮你 可是我不会啊
你能帮帮我吗? 我发的帖
https://www.bc-cn.net/bbs/dispbbs.asp?boardID=9&ID=57156&page=1

#4
yuxue19852006-04-13 10:51

来我给你一段代码

自己看看,我也给你说了你自己就学不到东西了

我给你的这个代码已经很明白了!·

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DBCtrls, DB, DBTables, StdCtrls, ExtCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Table1: TTable;
DataSource1: TDataSource;
DBImage1: TDBImage;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation
uses XMconsts;
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
if opendialog1.execute then
begin
table1.edit;
Tblobfield(table1.fieldbyname(dbimage1.datafield)).loadfromfile(opendialog1.filename);
table1.post;
end;
dbimage1.loadpicture;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Caption := '将图片导入到数据库中';
end;

end.

#5
missking2006-04-13 13:29
这是什么意思啊?能不能给我解释一下.我是用存储过程实现的,我看你这段代码好像是对表操作
1