我在测试一个存储过程,可是总出现如下错误
---------------------------
Debugger Exception Notification
---------------------------
Project prj_mis.exe raised exception class EListError with message 'List index out of bounds (0)'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
我的存储过程如下
CREATE PROCEDURE sp_test
@qsrq smalldatetime,
@zzrq smalldatetime
as
SELECT * from 测试表 where 登记日期 between @qsrq and @zzrq
go我的调用过程如下
ADOStoredProc1.ProcedureName:='sp_test';
ADOStoredProc1.Parameters[0].Value:='2005-05-11';
ADOStoredProc1.Parameters[1].Value:='2005-05-12';
ADOStoredProc1.ExecProc;执行到第二条就出错!请指点,
---------------------------
Debugger Exception Notification
---------------------------
Project prj_mis.exe raised exception class EListError with message 'List index out of bounds (0)'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
我的存储过程如下
CREATE PROCEDURE sp_test
@qsrq smalldatetime,
@zzrq smalldatetime
as
SELECT * from 测试表 where 登记日期 between @qsrq and @zzrq
go我的调用过程如下
ADOStoredProc1.ProcedureName:='sp_test';
ADOStoredProc1.Parameters[0].Value:='2005-05-11';
ADOStoredProc1.Parameters[1].Value:='2005-05-12';
ADOStoredProc1.ExecProc;执行到第二条就出错!请指点,
@qsrq datetime,
@zzrq datetime
as
begin
SELECT * from bill where bill_date between @qsrq and @zzrq
end
go ADOStoredProc1.ProcedureName:='sp_test';
ADOStoredProc1.Parameters.ParamByName('@qsrq').Value := strtodate('2005-05-11');
ADOStoredProc1.Parameters.ParamByName('@zzrq').Value := strtodate('2005-05-12');
//ADOStoredProc1.Parameters.CreateParameter('@zzrq',FtDate,pdInput,20,'2005-05-11');
ADOStoredProc1.ExecProc;
若不行,删掉ADOStoredProc1 重新添加一个