Board index » delphi » Obtaining result from a storred procedure (D6e, MS SQL, ado)

Obtaining result from a storred procedure (D6e, MS SQL, ado)


2004-07-21 10:57:30 PM
delphi161
Hi appologies for the long post.
I have the following stored procedure
CREATE PROCEDURE wc_name
@con_ref varchar(10),
@group_no varchar(3),
@wc_no varchar(6)
as
set nocount on
select d10, wc_desc, scope from dbo.wclist
where con_ref = @con_ref and group_no = @group_no and wc_no = @wc_no
GO
----------------------------------------------------
How do I obtain a result for "wc_desc" from the above..?
I have tried adding a parameter for output, but the best I can get is zero,
when there is a company name displayed when I try the same input in the
MS-SQL de{*word*81}.
with adostoredproc1 do
begin
label63.caption := label9.caption + label56.Caption;
parameters[1].Value := 'NB-75020'
parameters[2].Value := '001'
parameters[3].Value := 'B04';
execproc;
label62.caption := adostoredproc1wc_desc.value;
end;
Anyone have any ideas / examples ?
Regards
Dave
 
 

Re:Obtaining result from a storred procedure (D6e, MS SQL, ado)

"DA Brookes" <david_dot_brookes_at_interserveprojects.com>writes
Quote
>
with adostoredproc1 do
begin
label63.caption := label9.caption + label56.Caption;
parameters[1].Value := 'NB-75020'
parameters[2].Value := '001'
parameters[3].Value := 'B04';
execproc;
label62.caption := adostoredproc1wc_desc.value;
end;

Anyone have any ideas / examples ?
Regards
Dave
Dave,
Use the Open method instead of ExecProc.
Good luck,
krf
 

Re:Obtaining result from a storred procedure (D6e, MS SQL, ado)

Thanks Kevin!
Regards
Dave