The below code uses windows authentication, but If I want to override the current logon credentials and use a different userId and password what do I need to change : oServer.LoginSecure = True
Foe example the current windows logon is : AD\micky, but I want list all servers using a different user as AD\mouse.
Function listDatabases(vServer As String, vControl As Object)
Dim oServer As SQLDMO.SQLServer
Set oServer = New SQLDMO.SQLServer
oServer.LoginSecure = True
oServer.Connect vServer
For Each oDatabase In oServer.Databases
vControl.AddItem oDatabase.Name
Next
End Function