Link to home
Start Free TrialLog in
Avatar of Yadtrt
YadtrtFlag for Iraq

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.
Avatar of Leigh Purvis
Leigh Purvis
Flag of United Kingdom of Great Britain and Northern Ireland image

Returns a value how?

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.
Avatar of Yadtrt

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
ASKER CERTIFIED SOLUTION
Avatar of Leigh Purvis
Leigh Purvis
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial