Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Database Location problem in SQLExpress

Database Location problem in SQLExpress

Scheduled Pinned Locked Moved Database
databasehelptutorialquestionannouncement
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VikashGohil
    wrote on last edited by
    #1

    Hello, This is Vikash Gohil. I have a Software which is using MSDE Database (SQL2000). When the Software is run for the first time, it checks for the database name and if not found attaches the MDF and LDF files that are present in the "\Data" folder. I don't face any problem in this setup. Now I want to move from MSDE (SQl2000) to SQLExpress (SQL2005). I Created the MDF and LDF Files, Installed SQLExpress and My Software. After this I Copied the MDF and LDF Files in "\Data" Folder. The problem is, when I start the Software the database files are attached, but it shows below message: "Failed To Update Database "", the Database is Read-Only." And the software does not start. I want to know why this happens? I do not face such problems in MSDE. I have Searched for this on net and found that the SqlExpress should have rights for the folder where MDF and LDF Files Exists. But I don't know how to Set rights for my "Application Path\Data" Folder. I am totally new to SQL 2005. Please someone can help me in this matter. Any help would be greatly appreciated. Awaiting a reply, Thanks in Advance.

    M 1 Reply Last reply
    0
    • V VikashGohil

      Hello, This is Vikash Gohil. I have a Software which is using MSDE Database (SQL2000). When the Software is run for the first time, it checks for the database name and if not found attaches the MDF and LDF files that are present in the "\Data" folder. I don't face any problem in this setup. Now I want to move from MSDE (SQl2000) to SQLExpress (SQL2005). I Created the MDF and LDF Files, Installed SQLExpress and My Software. After this I Copied the MDF and LDF Files in "\Data" Folder. The problem is, when I start the Software the database files are attached, but it shows below message: "Failed To Update Database "", the Database is Read-Only." And the software does not start. I want to know why this happens? I do not face such problems in MSDE. I have Searched for this on net and found that the SqlExpress should have rights for the folder where MDF and LDF Files Exists. But I don't know how to Set rights for my "Application Path\Data" Folder. I am totally new to SQL 2005. Please someone can help me in this matter. Any help would be greatly appreciated. Awaiting a reply, Thanks in Advance.

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Check the dumb things first. Are the files/folder read only Does your app have permissions on the folder (some companies set admin rights to the program files folder) Have you set up the user correctly Is your connection string correctly formatted

      Never underestimate the power of human stupidity RAH

      V 1 Reply Last reply
      0
      • M Mycroft Holmes

        Check the dumb things first. Are the files/folder read only Does your app have permissions on the folder (some companies set admin rights to the program files folder) Have you set up the user correctly Is your connection string correctly formatted

        Never underestimate the power of human stupidity RAH

        V Offline
        V Offline
        VikashGohil
        wrote on last edited by
        #3

        Hello, MyCroft. Thanks for the reply. Are the files/folder read only? When I put the same files in the folder where system database files are present, i.e. Master, Model, etc., and then manually attach these files using Sql express Management studio, then there is no problem. The problem of Read-Only occurs only when data files are present in some other folder. Does your app have permissions on the folder? During Installation of the software, we have set the permissions as Everyone, so I don't think that is the problem. Also we have been using this with MSDE the same way and there are no problems. Have you set up the user correctly? We Use default 'sa' user for making connections. Also the ConnectionString is absolutely proper as it works fine with MSDE.

        M 1 Reply Last reply
        0
        • V VikashGohil

          Hello, MyCroft. Thanks for the reply. Are the files/folder read only? When I put the same files in the folder where system database files are present, i.e. Master, Model, etc., and then manually attach these files using Sql express Management studio, then there is no problem. The problem of Read-Only occurs only when data files are present in some other folder. Does your app have permissions on the folder? During Installation of the software, we have set the permissions as Everyone, so I don't think that is the problem. Also we have been using this with MSDE the same way and there are no problems. Have you set up the user correctly? We Use default 'sa' user for making connections. Also the ConnectionString is absolutely proper as it works fine with MSDE.

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          Ok so the dumb ones are covered. It still looks like 1 is the cause of the problems. If you move to another folder and attach the files does the connection work OK then. I don't use express but with SQL Server the server instance has an identity/credentials and these are used to access the file system. I would presume permissions on the data/log folders is set up on install of the database. Other folders may need specific permissions.

          Never underestimate the power of human stupidity RAH

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups