Hi @KunLi-4284,
Please make sure your SQL Server account have the permission to read and write data file
And for local db, you can try to drop the Initial Catalog
property
Referring to this thread:
https://stackoverflow.com/questions/17012839/cannot-attach-the-file-mdf-as-database/20176660#20176660
-------------
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.