Solved

Comparison of approach SQL=>Access

Posted on 2014-10-23
7
350 Views
Last Modified: 2014-10-23
Hi All,

SQL server 2008 with stored procedures returning data, some with parameters and some without.

MS Access 2007 front end.

What are the efficiency differences, and other considerations, between:

(1) Passthrough query with "EXEC sp"
(2) DAO connection with executed SQL "EXEC sp" & parameters, returning a recordset
(3) ADO connection, making use of the object model and adding parameters, returning a recordset

Thanks
0
Comment
Question by:James Elliott
7 Comments
 
LVL 57

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 200 total points
ID: 40399079
I use all three and the only consideration for me is the level of control that I want vs ease of use.

ADO gives you the most of how something executes, but it's on its way out as Microsoft is trending back to ODBC.

Performance wise, I've never bothered to check.  Would expect the first two to be almost identical.

Jim.
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 200 total points
ID: 40399084
I double you'll find much difference between the methods, with the possible exception of execution speed (and you could only determine that by doing your own timing tests). In some cases you might find method (1) to be fastest, for example, whereas in others you might find method (2) or (3).

Methods (1) and (2) means no outside dependencies, unlike Method (3), so there's always that. Not to say that ADO is difficult to deal with, but if you mark a reference for 2.8 and the user has 2.7, you'll get an error.

In general, working with ADO can be slightly less performant that working with DAO in Access, since DAO is tightly coupled. That said, I've never really seen any noticeable performance hits with ADO, even with larger datasets.

For my money, if I need to return a records from a SQL Server database, I use (3) and make sure I use an ADO reference that my target machines will have (like 2.5) and let Access "upsize" that reference as needed. No real reason for choosing that, other than the fact that it's what I've always used, and I'm comfortable with it. I've tried (1), and had good luck with it, but never really like the fact that I had to change the connection string of those pass-through queries when deploying. With ADO, I could store the new server/database info and recreate the connection string as needed for my connection object.
0
 
LVL 12

Author Comment

by:James Elliott
ID: 40399157
Thanks both.

Scott ==> Can you expand a bit on your deployment point. Why would the pass through queries need a new connection string? Could I not add an ODBC connection to my user's network profiles?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 84
ID: 40399184
Pass Through queries have a Connection property, which sometimes must be reset if you deploy to your end users. If you use a DSN then you could use the DSN in the connection property - however, you'd have to create that DSN on the user machine, or you'd have to insure it exists (and points to the right database).
0
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 100 total points
ID: 40399237
Ref the pass-thru connection string.  If you are using DAO, you may already be updating the connection string of your SQL linked tables (connecting to a production database versus a development one).  Updating the connection string of those pass-thru queries is no more difficult than doing so for the linked tables.
0
 
LVL 84
ID: 40399281
I agree that it's no more difficult, it's just one more step that needs to be handled.
0
 
LVL 12

Author Closing Comment

by:James Elliott
ID: 40399369
Thanks all. Great insight.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now