listing accessable databases for login

  • hai i am tring to list databases accessable by a particular user.

    if any1 hve solution plz reply soon

    -ashok

  • Try this:

    Dim i As Integer

    Dim oNames As SQLDMO.NameList

    Dim oSQLApp As SQLDMO.Application

     

    Set oSQLApp = New SQLDMO.Application

    Set oNames = oSQLApp.ListAvailableSQLServers()

     

    For i = 1 To oNames.Count

          ' do something with  oNames.Item(i)

    Next i

  • I am using this code to get a list of available QL servers, but it does not seem to work across subnets.  How can SQLDMO span subnets?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply