Solved

Comparison of approach SQL=>Access

Posted on 2014-10-23
7
347 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how the fundamental information of how to create a table.

707 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

12 Experts available now in Live!

Get 1:1 Help Now