TheNathan187
Junior Member
I've seen threads and postings about connecting to a database on a Windows VM. I don't necessarily have a problem regarding the configuration, setup. I have enabled TCP connections, browser agent is running and i opened the correct port on the firewall on the windows vm.
I am using visual studio code (mac) to work on an angular web project and visual studio for mac to create the api. On the windows vm, there is a sql server 2017 instance with various database.
My api can connect to the sql server database and I can query data. No problems there. The problem is with the database I try to connect to.
If I create a database from scratch and the security logins, it works fine.
The problem exists when I try to connect to a database that I restored from a database backup (bak file) from another machine. When my api tries to connect to a database that I restored from a .bak file...I always get a login error Login failed for user 'test_user'
I have tried to remap the orphan login via: EXEC sp_change_users_login 'Auto_Fix', 'user', 'login', 'password' or EXEC sp_change_users_login 'Auto_Fix', 'user'....I still get the error
I have also tried created a new login on that database server and map it accordingly......still get the error
Has anyone else had this happen and what did you do to fix this? Thanks in advance
I am using visual studio code (mac) to work on an angular web project and visual studio for mac to create the api. On the windows vm, there is a sql server 2017 instance with various database.
My api can connect to the sql server database and I can query data. No problems there. The problem is with the database I try to connect to.
If I create a database from scratch and the security logins, it works fine.
The problem exists when I try to connect to a database that I restored from a database backup (bak file) from another machine. When my api tries to connect to a database that I restored from a .bak file...I always get a login error Login failed for user 'test_user'
I have tried to remap the orphan login via: EXEC sp_change_users_login 'Auto_Fix', 'user', 'login', 'password' or EXEC sp_change_users_login 'Auto_Fix', 'user'....I still get the error
I have also tried created a new login on that database server and map it accordingly......still get the error
Has anyone else had this happen and what did you do to fix this? Thanks in advance