MS Sql 2005 Master DB sysprocess with ASP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rvl1980
    New Member
    • Sep 2006
    • 5

    MS Sql 2005 Master DB sysprocess with ASP

    I am having issue trying to obtain data from a query to MS SQL 2005 master database using a ASP to view the information. When I use management studio and run this query, I get the correct result.

    Code:
    select hostname, count(*) from master.sys.sysprocesses group by hostname
    When trying to implement this to write out to a asp page, the result is the machine that is hitting the DB and nothing more. This works for a MS SQL 2000 but why doesn't it work for 2005. Here is the ado snippt I am using to connect to the DB using DSN.
    Code:
    Set objConn = server.CreateObject("ADODB.Connection")
    
    objConn.Open "dbserver", "user", "password"
    
    strSQL = "select hostname, count(*) as ""Connection"" from master..sysprocesses (nolock) group by hostname order by ""Connection"" desc"
    
    Set sqlData = objConn.Execute(strSQL)
  • dorinbogdan
    Recognized Expert Contributor
    • Feb 2007
    • 839

    #2
    What error do you get?
    It occurs on objConn.Open, or on objConn.Execute ?

    Comment

    • rvl1980
      New Member
      • Sep 2006
      • 5

      #3
      The odd thing is, I am not getting any Errors.
      The page works but it doesn't show the correct information.
      What it shows is the web machine that is accessing the sql 2005 machine.

      Comment

      • rvl1980
        New Member
        • Sep 2006
        • 5

        #4
        Originally posted by rvl1980
        The odd thing is, I am not getting any Errors.
        The page works but it doesn't show the correct information.
        What it shows is the web machine that is accessing the sql 2005 machine.

        This is what I get from 2000 and 2005 sql from my asp.

        From MS SQL 2000 using asp to display
        Host Num of Connection(s)
        Server123 118
        WSX0160 90

        From MS SQL 2005 using asp to display
        Host Num of Connection(s)
        TRACKING 1

        Comment

        • rvl1980
          New Member
          • Sep 2006
          • 5

          #5
          I guess there no help with this?

          Comment

          Working...