Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detemining how many connections you have to a database
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00901212
Message ID:
00901587
Views:
22
>Hi,
>
>I'm in the process of writing a program that will automate the SQL Detach command so that I may copy their database to my system. My problem is that the Detach command will fail if there is users using it, for pretty obvious reasons, so I would like to know when the number of connections to the database is zero.
>
>Perhaps there is another way.
>
>
>TIA
>
>Peter

I have a sample that does that, however, I don't have it here with me. Drop me an email and/or I will post it tonight. I'm pretty sure it uses SQL-DMO, but can't for the life of me remember how I set it up.

Also, check out the sp_who system stored proc in the BOL. That SP will tell you who's connected to what.
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Previous
Reply
Map
View

Click here to load this message in the networking platform