Solved

Comparison of approach SQL=>Access

Posted on 2014-10-23
7
356 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

792 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