H
herohualiu
Unregistered / Unconfirmed
GUEST, unregistred user!
选用dcom做中间层。我有个问题想请教高手。在数据库服务器中写了存储过程,
CREATE PROCEDURE InsertMember
@logname varchar(50),@pwd varchar(20),@question varchar(50),
@answer varchar(50),@email varchar(50),@company varchar(200),@memo text,
@zip varchar(10),@address varchar(100),@tel varchar(100),@mobile varchar(50),
@fax varchar(100),@connecter varchar(50),@url varchar(50),@country varchar(20),
@province varchar(50),@city varchar(20),@mentype int,@vis int,@renshu varchar(50),
@frdb varchar(15),@yye varchar(50),@khyh varchar(50),@yhzh varchar(30),
@zczj varchar(20),@products varchar(200),@kindinfo varchar(50),@logtime Datetime,
@keyword varchar(100),@Nomail_me int,@QXID char(10)
as
insert member values(@logname, @pwd, @question, @answer, @email,
@company, @memo, @zip, @address, @tel, @mobile, @fax, @connecter,
@url, @country, @province, @city, @mentype, @vis, @renshu, @frdb,
@yye, @khyh, @yhzh, @zczj, @products, @kindinfo, @logtime, @keyword,
@Nomail_me, @QXID)
GO
在应用服务器中写入了调用存储过程的方法:
procedure TRDBWTSL.Callproc(const ProcName: WideString;
ParaNum: OleVariant);
var
i:integer;
begin
with ADOSProcdo
begin
ProcedureName:=ProcName;//存储过程名
Parameters.Refresh;
for i:=1 to Parameters.Count-1do
begin
Parameters.Value:=ParaNum[i-1];//传递参数
end;
Prepared:=True;
ExecProc;
Prepared:=False;
end;
end;
然后在客户端调用这个方法来传递存储过程所需的参数:
DataModFrm.CDSMemberProc.Close;
DataModFrm.DCOMConn.AppServer.Callproc('InsertMember',vararrayof([参数1,参数2]));
DataModFrm.CDSMemberProc.Execute;
但在提交中,数据在数据库服务器中写了两次,不知何原因?谢谢!
CREATE PROCEDURE InsertMember
@logname varchar(50),@pwd varchar(20),@question varchar(50),
@answer varchar(50),@email varchar(50),@company varchar(200),@memo text,
@zip varchar(10),@address varchar(100),@tel varchar(100),@mobile varchar(50),
@fax varchar(100),@connecter varchar(50),@url varchar(50),@country varchar(20),
@province varchar(50),@city varchar(20),@mentype int,@vis int,@renshu varchar(50),
@frdb varchar(15),@yye varchar(50),@khyh varchar(50),@yhzh varchar(30),
@zczj varchar(20),@products varchar(200),@kindinfo varchar(50),@logtime Datetime,
@keyword varchar(100),@Nomail_me int,@QXID char(10)
as
insert member values(@logname, @pwd, @question, @answer, @email,
@company, @memo, @zip, @address, @tel, @mobile, @fax, @connecter,
@url, @country, @province, @city, @mentype, @vis, @renshu, @frdb,
@yye, @khyh, @yhzh, @zczj, @products, @kindinfo, @logtime, @keyword,
@Nomail_me, @QXID)
GO
在应用服务器中写入了调用存储过程的方法:
procedure TRDBWTSL.Callproc(const ProcName: WideString;
ParaNum: OleVariant);
var
i:integer;
begin
with ADOSProcdo
begin
ProcedureName:=ProcName;//存储过程名
Parameters.Refresh;
for i:=1 to Parameters.Count-1do
begin
Parameters.Value:=ParaNum[i-1];//传递参数
end;
Prepared:=True;
ExecProc;
Prepared:=False;
end;
end;
然后在客户端调用这个方法来传递存储过程所需的参数:
DataModFrm.CDSMemberProc.Close;
DataModFrm.DCOMConn.AppServer.Callproc('InsertMember',vararrayof([参数1,参数2]));
DataModFrm.CDSMemberProc.Execute;
但在提交中,数据在数据库服务器中写了两次,不知何原因?谢谢!