I am trying to connect to a SQL Express database by using a connection string from a VB Windows application in Visual Studio but I get the following error. I tried getting a solution in the Microsoft SQL Server: Programming forum but was unable to. I am using the latest version of Visual Studio, Sql Express and XP sp2. Any help would be appreciated. I am trying to do this on my laptop and no one else has access to the file. I can go to the SQL Server Management Studio and look at the tables and data and so forth. TIA.
Error:
Unable to open physical file "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\myfile.mdf". Operating system error 32: 32(The process cannot access the file because it is being used by another process.)" An attempt to attach an auto-named database for file "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\myfile.mdf" failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Error:
Unable to open physical file "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\myfile.mdf". Operating system error 32: 32(The process cannot access the file because it is being used by another process.)" An attempt to attach an auto-named database for file "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\myfile.mdf" failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.