我是使用DbExpress中的TSQLConnection和TSQLStoredProc来调用SqlServer存储过程,但怎么也连不上,是不是存在Bug?
我建的表很简单:
id int 4 //自动加1
user_handphone char 15
act_num char 10
存储过程如下:
CREATE PROCEDURE add_dxtp
@iuser_handphone varchar(15),
@iact_sum varchar(10)
as
insert into dxtp (user_handphone,act_num)
values(@iuser_handphone,@iact_sum)
GO
程序如下:
procedure TForm1.Button1Click(Sender: TObject);
begin
SQLStoredProc1.SchemaName:='dbo';
SQLStoredProc1.StoredProcName:='dbo.add_dxtp';
SQLStoredProc1.Params.Clear;
SQLStoredProc1.Params.CreateParam(ftString,'@iuser_handphone',ptinput);
SQlstoredproc1.Params.CreateParam(ftString,'@iact_sum',ptinput);
SQLStoredProc1.Params.ParamByName('@iuser_handphone').Value:=edit1.Text;
SQLStoredProc1.Params.ParamByName('@iact_sum').Value:=edit2.Text;
SQLStoredProc1.ExecProc;
end;
调用过程和程序都很简单,但是就是连不上,请大家给点意见,先谢了!