How to move LocalDB mdf files

20 Views Asked by At

Could you please help me look into this issue?

Steps:

  1. User Administrator created a LocalDB file under C:\Users\Public\Documents\MyDB
  2. Moved the file to C:\Users*Admin*\MyDB

that is, the mdf file was moved from user to user.

Result: After moving, the file cannot be opened in my program, the openEx function throws an exception.

Error msg: An attempt to attach an auto-named database for file "...\myDb.mdf" failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

enter image description here

I made sure that the admin user had full control permissions and inherited permissions during the move.

0

There are 0 best solutions below