4

I am having to develop an application very rapidly. I have chosen SQL Server (2012) as the DB backend, and I will write all my stored procs, triggers etc in the backend.

However, for UI (logon, reporting etc), I am using Access 2010 for the frontend. I am new to both Access used earlier versions of Access waaay back in the day) and SQL Server (familiar with other Db's).

The goal is to have the database reside on a server and let clients connect with an instance of Access 2010 running locally on their machine.

I am looking for a quick tutorial that shows me how to use the SQL server objects from the Access frontend (I believe its called linking) - any link to useful resource would be very helpful, as I can't seem to locate anything useful (I may searching using the wrong keywords).

2
  • Sql Server 2010 ? there is only 2005 --> 2008 --> 2008 R2 --> 2012 --> 2012 R2 and now 2014 Sql server. Commented May 4, 2014 at 15:37
  • @M.Ali -Ah, I stand corrected. It's SS 2012 Commented May 4, 2014 at 16:09

3 Answers 3

5

Assuming you built all the tables and data on SQL server, then in Access it is a simple matter to link Access to that database.

And to save development time, you can continue to use the Access simple approach of using forms bound to those tables. As long as you launch a form with some kind of criteria (say an invoice number), then that bound form will ONLY pull down the one record from SQL server into that form. (so need to write or use store procedures etc. for that form). And any triggers etc. you have built in SQL server will run without you having to do anything from the Access side.

So a plane jane form build in Access that is bound to a table of say 1 million rows in Access does not need any “special” code – just make sure you launch the form with the “where” clause that Access provides and the form will only pull + load the one record.

So 99% of the normal development process you used in Access in the past will continue to work. Using SQL server for the most part does not change much if anything in regards to building forms that edit such data.

However, for reports and some forms that query + search for data etc., or some VBA code that needs to “process” data, you are most free to call store procedures. You simply create a pass-through query in Access. The VBA code to use that T-SQL thus looks like this:

Currentdb.QueryDefs("MyRawt-sqlPassThoughquery").Execute

Or

with CurrentDb.QueryDefs("MyPass") 
     .SQL = "exec sp_myProc" 
     .Execute
end with

In the past for most access applications you likely used liked tables – those linked tables can be to a Access file (back end), or Oracle, or SQL server – how the actual application works and functions is really much the same for all cases. (so there not really a lot of “specific” things you need to know from the Access side – if you comfortable with Oracle, or SQL server, then using Access as a front end works just fine, and the typical development approaches used in Access will remain typical.

Here is an article that outlines the linking process:

https://support.office.com/en-us/article/Import-or-link-to-SQL-Server-data-A5A3B4EB-57B9-45A0-B732-77BC6089B84E?ui=en-US&rs=en-US&ad=US&fromAR=1

Keep in mind you will see MANY articles that talk about ADP projects - they have been deprecated since Access 2010, and I don't recommend using ADP projects with Access - so be careful, since many articles that talk about Access + SQL server are built around ADP projects which as noted should not be used anymore.

Sign up to request clarification or add additional context in comments.

5 Comments

Although this is an excellent and highly detailed answer, I feel that an Access data project is far superior to using linked table and views (and DAO for that matter)
Perhaps, but ADP support been gone for fully 2 versions now. You have to go back to Access 2010 for ADP's to work. Beyond that, you can't use ADP projects with Access.
Yes, ADP is being decomissioned but look at the title of the question and consider that this is clearly a SQL Server centric app. How do you call stored procedures through linking? I'm not sure but I do know they are very well supported in ADP's
Try reading my above post. I have a DAO example of calling a store procedure in the above. (and I don't even have to declare ONE variable in VBA in the above example. So the above uses a pass-though query which is not linked. A Pass-trough query does contain a connection string. You can provide a connection string in code, but why bother when the above DAO example of calling a store proc is so simple and easy?
And how does title talking about 2010 take into account that it is the last version? The idea that one would adopt a development approach that is 3 versions and cycles old makes very little sense. I can't imagine anyone investing hard earned dollars into a application choice that is already depreciated? I always thought ADP's are great, but ignoring that .net dropped ADO 10+ years ago (they use ado.net - a VERY different beast and it based on sqlproviders - not the original ADO).
0

This office.microsoft.com article should give you a good overview.

With plenty of more technical information searching for "query sql server from ms access".

Comments

-3

Don't mess about with linked tables. Use an Access ADP (Access data project), which is natively connected to SQL Server. Sadly this type of access file is being phased out but it is the optimal solution for an MS Access front end with a SQL Server back end

Pros and Cons of Access Data Project (MS Access front end with SQL Server Backend)

5 Comments

ADPs were depreciated TWO versions ago (access 2010). So ADP projects are not supported or even allowed after 2010. Next big problem is SQL server is dropping oleDB support (and has started depreciating oleDB in recent versions). Since ADP's use ADO and oleDB, then the writing on the wall is doubly bad for those still stuck on the industry leaving oleDB behind (so it is SQL that's dropping and moving away from oleDB support). Regardless, ADP were removed from Access fully 2 versions ago. ADP's are gone as a viable choice like suggesting to use the DOS version of FoxPro.
But look at the title of the question... this is Access 2010. Linked tables (DAO) are an older technology than ADO. ADP's natively use lots of SQL functionality that linked tables can't, which appears to be key to this question. You are 100% right that it is being deprecated but I also made that obvious in my answer
well, it is ADO that being depreciated here. The .net community started dumping ADO more then 10 years ago. Access now does not use nor require a reference to DAO now uses the ACE engine. So ACE is the "new" version of DAO - it backwards compatible and is receiving new features - something ADO is not. So not only did the .net community dump ADO 10+ years ago, but SQL server is ALSO dropping oleDB support. "oleDB" is a windows only technology. The recommend approach is OpenDataBaseConnetvity - it is the way forward and is platform neutral.
For a requirement that can be boiled down to "I am using MS Access 2010 and I am heavily using SQL Server database objects such as stored procedures and I need to develop an application very rapidly", then an ADP platform seems ideal, of course with the catch that it is being deprecated. Which is basically my answer. You might find it faster to develop using linked tables. We don't know the future development path for this app.
I believe you are right about the other points with deprecation of all the other various libraries but I have to say I've never seen a .Net app built using an ODBC driver connecting to SQL Server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.