调用存储过程前是不是最好先close一下,可是这样会出现问题,
db1.dh_insert.close
db1.dh_insert.Parameters.ParamByName('@dinghuohao').Value:=trim(labelededit1.Text);
db1.dh_insert.Parameters.ParamByName('@tuoyunren').Value:=trim(combobox1.Text);
报错说参数@dinghuohao找不到,可是明明是有这个参数的,把前面那个close去掉就好了。我以为是这个关系
可是在下一个存储过程中
db1.dh_update.Parameters.ParamByName('@dinghuoid').Value:=db1.dinghuohetong.fieldbyname('订货id').AsInteger;
db1.dh_update.Parameters.ParamByName('@dinghuohao').Value:=trim(labelededit1.Text);
明明有@dinghuoid这个参数的,可是报错说没有,实在找不到原因。我用的是Tadostoredproc