Avatar of Kevin Freeman
Kevin Freeman
Flag for United States of America

asked on 

Error Using Access Database With Visual Studio Attached To SQL Server

I am building with Visual Studio, a Project, WPF App, I have the Database.mdf (MDF) file, for the Visual Studio Project, attached to SSMS (SQL Server Management Studio) under Databases. I have SQL Server Running in SQL Server Configuration Manager and I am using a Standard User Account in Windows but have the Standard User under Security in SQL Server Management Studio. As well, I have created a Microsoft Access Database in the project and it is, Database.accdb (ACCDB), with Linked Tables in the Access File Linked to the Database.mdf. When I run the Visual Studio Program I get the following errors:

Error 1
Could not copy "C:\Users\(User)\source\repos\Program\Program\Database.mdf" to "bin\Debug\Database.mdf". Exceeded retry count of 10. Failed.   Program  

Open in new window

Error 2
Unable to copy file "C:\Users\(User)\source\repos\Program\Program\Database_log.ldf" to "bin\Debug\Database_log.ldf". The process cannot access the file 'C:\Users\(User)\source\repos\Program\Program\Database_log.ldf' because it is being used by another process.   Program    

Open in new window

Error 3
Unable to copy file "C:\Users\(User)\source\repos\Program\Program\Database.mdf" to "bin\Debug\Database.mdf". The process cannot access the file 'C:\Users\(User)\source\repos\Program\Program\Database.mdf' because it is being used by another process.   Program  

Open in new window

I am guessing that this is a Configuration Problem, if I Stop SQL Server in SQL Server Configuration Manager the Visual Studio Program runs but cannot login the Database.mdf file. What do I need to change to be able to run the program and link the tables in Access, Database.accdb, to the Database.mdf file?
* SSMSDatabasesMicrosoft SQL ServerMicrosoft Visual Studio

Avatar of undefined
Last Comment
Andrei Fomitchev

8/22/2022 - Mon