Solved

How to kill all connections in sql server from visual basic application ???

Posted on 2004-08-26
4
298 Views
Last Modified: 2013-12-25
I tried to use SQLDMO from vb but it caused some errors is there any better solution for killing all connection sql server, I need to do it before database restore
Thanks
0
Comment
Question by:Pkrol1
  • 2
4 Comments
 
LVL 29

Expert Comment

by:leonstryker
ID: 11904659
What errors?

Leon
0
 
LVL 29

Accepted Solution

by:
leonstryker earned 500 total points
ID: 11904683
Take a look at this:

http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_21088898.html

You can create this procedure and then execute it with ADO.

Leon
0
 
LVL 15

Expert Comment

by:jdlambert1
ID: 11908337
You should run it from SQL Server, rather than SQLDMO, because it will try to kill SQLDMO's connection.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

809 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