Solved

Comparison of approach SQL=>Access

Posted on 2014-10-23
7
353 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

I have a large data set and a SSIS package. How can I load this file in multi threading?
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

816 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

10 Experts available now in Live!

Get 1:1 Help Now