locked
error when i want to attach database RRS feed

  • Question

  • hello everyone

    when i want to attach database to my c# project i give this error message.

    directory lookup for the file c:\.....\test1.mdf failed whid the oprating system error 5 (access is denied)

    can not attach the file c:\.....\test1.mdf as database 'test1'.

    how can fix this problem

    Monday, April 15, 2013 6:56 AM

All replies

  • directory lookup for the file c:\.....\test1.mdf failed whid the oprating system error 5 (access is denied)

    Hello,

    As the error message already says, the SQL Server service account don't have the permissions to access the database files. Move the database file to the DATA subfolder of your SQL Server installtion, here the service account do have enough permissions to read/write to the files.


    Olaf Helper

    Blog Xing

    Monday, April 15, 2013 7:16 AM
  • i copied the test1.mdf to data folder

    when i try to attach this file i give an error:

    this file is in use.

    inter a new name or close the file thats open in another program.

    when i stop mssql service i can select this file but when i select test connection button i give this error

    a network related.......error:40 (could not open a connection to sql server)

    Monday, April 15, 2013 7:35 AM
  • hello everyone

    when i want to attach database to my c# project i give this error message.

    directory lookup for the file c:\.....\test1.mdf failed whid the oprating system error 5 (access is denied)

    can not attach the file c:\.....\test1.mdf as database 'test1'.

    how can fix this problem

    • Merged by Angie Xu Tuesday, May 7, 2013 6:14 AM the same post
    Monday, April 15, 2013 10:50 AM
  • this file is in use.


    Then you selected a MSF file, which is already attached as database.

    Olaf Helper

    Blog Xing

    Monday, April 15, 2013 10:57 AM
  • Monday, April 15, 2013 10:57 AM
  • i dettach this file but i recieve this error yet.
    Monday, April 15, 2013 11:05 AM