Solved

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

Posted on 2014-11-17
3
720 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
Comment Utility
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
 

Author Comment

by:gdunn59
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

728 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

10 Experts available now in Live!

Get 1:1 Help Now