Solved

How to Open SQL Server Management Studio via VBA from MS Access

Posted on 2014-11-17
3
823 Views
Last Modified: 2015-01-08
I have an Access Database and I would like to add a button to my form that will automatically open SQL Server Management Studio (SSMS) via VBA.

How can I accomplish this?

Thanks,

gdunn59
0
Comment
Question by:gdunn59
  • 2
3 Comments
 
LVL 84
ID: 40448121
What would be the point of that? Just curious, really ...

You could use the Shell command to execute the executable. In my case, it's installed here:

C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio

So I'd use this:

Shell "C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\ssms.exe"
0
 
LVL 1

Author Comment

by:gdunn59
ID: 40453286
Scott:

Because this is just the first step that a user has to do before finalizing a report that I have programmed in Access.  I just wanted to make it easier for the user when they launch my database, they can click a button to open SQL Server and have the query already there on the screen and ready to execute.

Thanks,
gdunn59
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40454801
I still don't really follow. You can run a query against a SQL Server table by opening a connection to SQL server and running it:

Dim con As New ADODB.Connection
con.ConnectionString = "your connect string"
con.Execute "SELECT * FROM Some_Table"

Even if the user must interact with the query (which is odd), you could use the Access Query Editor to do that. Just create a PassThrough query, or create a linked table or tables to the SQL Server and use that.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

749 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