I am using the current code in attempt to access a msSQL 2005 db:
if you using windows 10.
step 1. click start button
step 2. type Service and enter (open App Services)
step 3. find - SQL Server (MSSQLSERVER)
step 4. Right click ->select Properties
step 5. show popup. you select 2nd tab (Log On)
step 6. select local system account
step 7. and check allow service to interact with desktop
step 8. finally click ok.
1 time refresh now connected. I hope it's very useful