各位同行,怎样动态创建一个Tstoredproc ,用完后在free.
以下是我的源代码:
delphi:
p_get_priceout:=Tstoredproc.Create(dm);
p_get_priceout.Databasename:='db_csgl';
p_get_priceout.StoredProcName:='p_getprice;1';
p_get_priceout.ParamByName('@bar_code').AsString:=barcode;
p_get_priceout.execproc;//出错,没有找到参数@bar_code
price_out:=p_get_priceout.ParamByName('@price_out').AsCurrency;
result:=price_out;
存储过程源代码:
create procedure p_getprice--得到某货品的出售价格
@bar_code varchar(20),
@price_out money output
as
begin
set @price_out=(select cur_price from goods
where bar_code=@bar_code)
end
以下是我的源代码:
delphi:
p_get_priceout:=Tstoredproc.Create(dm);
p_get_priceout.Databasename:='db_csgl';
p_get_priceout.StoredProcName:='p_getprice;1';
p_get_priceout.ParamByName('@bar_code').AsString:=barcode;
p_get_priceout.execproc;//出错,没有找到参数@bar_code
price_out:=p_get_priceout.ParamByName('@price_out').AsCurrency;
result:=price_out;
存储过程源代码:
create procedure p_getprice--得到某货品的出售价格
@bar_code varchar(20),
@price_out money output
as
begin
set @price_out=(select cur_price from goods
where bar_code=@bar_code)
end
解决方案 »
- delphi 中在一个类中加过程出错?
- Delphi 如何编程实现更改文件大小
- 无法用ADO连接Access数据库.
- 急啊, 这样的问题怎么解决(ADOQUERY的新增记录问题)??????????????
- 加急!编写Nt service程序出现问题
- 100分求救一个异常的解决,大虾们都进来看看
- 100分求问怎样给多窗体程序的客户区加图片?
- SpinEdit是什么?
- access中长表名数据要怎么取?
- 200分等你拿,http://www.csdn.net/expert/topic/1025/1025735.xml?temp=.1982996
- 如何从DBGRID的某一列的某一行中输入一个字符串然后 回车,用输入的字符串做为参数 在线上呢.
- 用ADODBConnection如何锁住一个表
tmpStp.Params.CreateParam(ftString,'@Name', ptInput);
tmpStp.Params.CreateParam(ftInteger,'@ValueMin', ptInputOutput);
tmpStp.Params.CreateParam(ftInteger,'@ValueMax', ptInputOutput);
tmpStp.Params[0].AsString:='x';