Solved

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

Posted on 2014-11-17
3
833 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 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

734 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