A few days from the internet to find a few ASP.net login cases to study the code, the results of the use of SQL Server2005 attached to the database file pop-up error message:
See Netizen Reply said: Just give authenticated users all permissions on the line.
I also encountered a similar problem, but the solution is simple, you need to use the administrator's identity to open SQL Server Management Studio, you can attach the database
The following figure:
, temporarily no solution, and then turn to Baidu Google, after a variety of experiments, special will solve the solution in this, hope to help everyone, at the same time, if there is a good opinion of everyone a lot of exchanges Ah!
Option one: Switch login mode
This occurs because of the use of mixed authentication (SQL Server Authentication) to log on to the database, as long as you change the logon mode to "Windows Authentication Mode"
Login to resolve the problem, the additional success after the replacement of "Mixed authentication Mode" Landing will be no problem.
This method was successfully tested by myself.
Programme II: Modifying services
Select All Programs-sql Server 2005-Configuration tool-Select SQL Server Configuration Manager or SQL Server Configuration Manager.
Open the SQL Server Configuration Manager Configuration interface, select SQL Server 2005 service on the left, right-click on the properties of SQL Server (SQLEXPRESS) on the right, and network services in the built-in account-" Network Service "Local System" instead
Click on "reboot" and then attach the database OK.
This method was successfully tested by myself.
After the additional database is successful, if you are worried about changing the settings, you can change the "local System" of the built-in account back to
"Network Service", the database can still be opened.
The main configuration process is shown below:
1. Open the SQL Server Configuration Manager Configuration Interface:
2. Select SQL Server (SQLEXPRESS), options, and right-click:
3. Select "Local System":
4. Select "Reboot":
5. Configuration success:
This will not be an error if you attach the database after this configuration.
The problems that arise:
Someone on the internet said: Copy the database files to other folders and attachments can be attached, but this method after I test invalid.
Solution to discovering database properties as read-only after attaching a database
The append found that the Database property is read-only resolution is:
Open Sql Server??, and Right-click the selected property on the read-only database, select options under Select Page on the left of the Properties window, and on the right side of the window, make the database read-only item
Change to "False" and click OK.
Reason: The database attached is "read-only" because the default startup account "Network Service" that starts SQL Server has an attached (Attach) database file
Due to insufficient authority. This method was successfully tested by myself.
The main configuration process is as shown:
Step One:
Step Two: