Advertisement

04.01.2008 at 10:05AM PDT, ID: 23286456
[x]
Attachment Details

Get SQL query result in VBA variable

Asked by RossEdwards in Microsoft ADP, Microsoft Access Database, MS SQL Server

I have an Access project linked to SQL server data.

In my VBA code I want to get the result of a query into a variable.  The stored proc returns one value, with a field name of "count".  In Access I would normally use DLookup but this wont work with SQL procs.

I can successfully run SQL procs using DoCmd.RunSQL but how can I assign their results to variables?

Kind regards.Start Free Trial
[+][-]04.01.2008 at 10:09AM PDT, ID: 21255979

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 10:12AM PDT, ID: 21256011

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 10:13AM PDT, ID: 21256026

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft ADP, Microsoft Access Database, MS SQL Server
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 4
Solution Grade: B
 
 
[+][-]04.01.2008 at 02:18PM PDT, ID: 21258175

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 02:33PM PDT, ID: 21258316

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 11:17PM PDT, ID: 21260506

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.02.2008 at 07:11AM PDT, ID: 21263200

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628