Solved

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

Posted on 2014-11-17
3
854 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 85
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 85

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 ?
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Viewers will learn how the fundamental information of how to create a table.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

705 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