Database Location problem in SQLExpress
-
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.
-
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.
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
-
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
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.
-
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.
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