Yadtrt
asked on
Using sp value in access vba
I have a stored procedure in SQL Server 2005 that return a value,I want to use that value the access VBA 2007 without using ADO. Is is possible? or there is no way I should use ADO.
ASKER
I want to return single value just like this procedure,
create procedure testD
@nVal int
@Dval int output
as
begin
If EXISTS (select Ncol from Table1 where F1=@Nval)
set @Dval=2
end
How can I use the @Dval value in the Access VBA
create procedure testD
@nVal int
@Dval int output
as
begin
If EXISTS (select Ncol from Table1 where F1=@Nval)
set @Dval=2
end
How can I use the @Dval value in the Access VBA
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you return it as a recordset (i.e. SELECT the value rather than return it) then you could use the Access Application object to return it - but you'd be implementing default ADO methods from that application (so not circumventing ADO).
If you simply return the value then you'll not necessarily even get that value at all!
Ideally you'd return it as an Output parameter - but you will then need be using ADO explicitly to retrieve that value.