[AccessD] Returning the value from a stored procedure

Michael Mattys michael at mattysconsulting.com
Thu Apr 18 06:40:07 CDT 2013


I think you want executescalar.
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.exe
cutescalar.aspx

Michael R Mattys
Mattys Consulting, LLC
www.mattysconsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John W Colby
Sent: Wednesday, April 17, 2013 4:18 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Returning the value from a stored procedure

I want to execute a stored procedure that just returns a single value.  The
value will be a long since that is what stored procedures can return without
jumping through hoops.\

I can use an db.OpenRecordset("MySPName") to return an entire table but I
don't want to do that, just get a single value which is not a recordset.

So what syntax do I use to get this value back in Access?

--
John W. Colby

Reality is what refuses to go away
when you do not believe in it

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list