我在程序中动态的创建了一个TADOStoredProc,使用完后如何彻底的删除它呢??

zhangchao_7622 2004-07-22 10:31:17
谢谢高手了??
...全文
121 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
yinzhiw 2004-07-22
  • 打赏
  • 举报
回复
Free
qhf503 2004-07-22
  • 打赏
  • 举报
回复
fADOStoredProc.Free ;
delphidj 2004-07-22
  • 打赏
  • 举报
回复
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
ADOStoredProc1: TADOStoredProc;
ADOTable1: TADOTable;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
fADOStoredProc:tADOStoredProc;
begin
try
fADOStoredProc:=tADOStoredProc.Create(self);
fADOStoredProc.ConnectionString :=ADOTable1.ConnectionString ;
fADOStoredProc.ProcedureName := 'dt_verstamp006' ;
fADOStoredProc.Open ;
finally
fADOStoredProc.Free ;
end;

end;

end.
mydelphiworld 2004-07-22
  • 打赏
  • 举报
回复
up
drift1981 2004-07-22
  • 打赏
  • 举报
回复
动态创建并释放都是
try
....
finally
*.free

2,497

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧