Board index » delphi » Listing connections to a SQL Server 7 db

Listing connections to a SQL Server 7 db

I have an application that connects to a user database on SQL Server 7 using
the BDE.

I wish to list the current connections to the database I am currently
connected to. (Stuff like host name and program name)

I have seen that you can access this information by looking in the master
database, however if i assume correctly this would require another database
connection and require a user login with access to this db?

Thanks in advance

Dan

 

Re:Listing connections to a SQL Server 7 db


I'd say that the safest way to go about doing this is to call sp_who or
sp_who2. In any other way, you'd have to read system tables. That would 1.
force you to give users more permissions than they need and 2. make you
dependent of SQL Server versions since MS does change structure of system
tables but procedure (name) remain the same.

Also, I'm not certain, but there might (must) be a way to do this with SQL
DMO but I wouldn't know how without digging deep(er).

rb

Quote
"Dan Parker" <d...@borer.co.uk> wrote in message news:3cc03379_2@dnews...
> I wish to list the current connections to the database I am currently
> connected to. (Stuff like host name and program name)

> I have seen that you can access this information by looking in the master
> database, however if i assume correctly this would require another
database
> connection and require a user login with access to this db?

Other Threads