Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS SQL Server Stored Procedures

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi

I wish to access a stored procedure using ADO in Delphi 6. The stored procedure (sp_getschedule) is written in MS SQL Server and takes one input parameter called @ScheduleDate.

I wrote the following code segment in Delphi to execute the stored procedure:

with frmMain.ADOStoredProc do begin

Active := False;
Parameters.ParamByName('@ScheduleDate').Value := Date;
ProcedureName := 'sp_getschedule';
Open;
Active := True;

end;

When executed, Delphi returns the error:

ADOStoredProc: Parameter '@ScheduleDate' not found

Any suggestions would be greatly appreciated.

-Andrew
 
Try

1) Set the Procedure name before you assign values to the parameter

and

2) ParamByName('ScheduleDate').asDate := Date;


or

3) ParamByName('ScheduleDate').value := Date;


S. van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top