problems with attaching a DataBase to SQL 2008 in win 7

This is a discussion on problems with attaching a DataBase to SQL 2008 in win 7 within the C# Programming forums, part of the General Programming Boards category; Hello, I had Windows XP, Microsoft visual studio.net2005 and SQL Server 2008 installed on my PC. All of my projects ...

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    177

    problems with attaching a DataBase to SQL 2008 in win 7

    Hello,

    I had Windows XP, Microsoft visual studio.net2005 and SQL Server 2008 installed on my PC.
    All of my projects files, folders and data bases have always been on the G drive.

    some days ago, I installed Win7(64 bit), Microsoft visual studio.net2008 and SQL Server 2008 on the C drive and I have a big problem now
    I cant attach any of the data bases to SQL! This is the error I get any time I try to attach a DB:

    Code:
    Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)
    
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476
    
    ------------------------------
    ADDITIONAL INFORMATION:
    
    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
    
    ------------------------------
    
    CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'G:\AI\dataBase\myWord\myWords.mdf'. (Microsoft SQL Server, Error: 5123)
    
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3042&EvtSrc=MSSQLServer&EvtID=5123&LinkId=20476
    
    ------------------------------
    Can you tell me, how I can solve the problem?

    Tnx Arian

  2. #2
    Registered User valaris's Avatar
    Join Date
    Jun 2008
    Location
    RING 0
    Posts
    507
    Make sure you have the correct permissions to the directory G:\AI\dataBase\myWord
    Perhaps try running as administrator to attach.

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    177
    somebody told me:
    On a NTFS partition you should tick the "filestream" option while installing SQL. So I reinstalled it with the new option.

    After instalation I checked if I could attach the DataBases.
    The first one was "MyWord" and it attached with no problems. I didn't check the next 2 as I though there would be no problems either.

    I wanted to work on my project today and I tried to attach the other DBs but I found it imposible
    Also the priviously attached database (myWord) has become readonly. I can attach/detach it but when it is attached I see "(Read-only)" infront of its name in the object Explorer.

    the strange part is that I get 2 different errors while trying to attach the next 2 DBs.
    even I can copy and paste both of them to other drives and the "read only" attribute is not checked in the property page, I get these two error messages:

    1- for the "verb" DB:
    Code:
     
    Attach database failed for Server 'CHAKAVEH-PC'.  (Microsoft.SqlServer.Smo)
    
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
    
    ------------------------------
    ADDITIONAL INFORMATION:
    
    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
    
    ------------------------------
    
    Database 'verb' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery. (Microsoft SQL Server, Error: 3415)
    
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=3415&LinkId=20476
    2- for the "WSD" DB
    Code:
    Attach database failed for Server 'CHAKAVEH-PC'.  (Microsoft.SqlServer.Smo)
    
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
    
    ------------------------------
    ADDITIONAL INFORMATION:
    
    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
    
    ------------------------------
    
    Unable to open the physical file "C:\DB\WSD.mdf". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)
    
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476


    Can you please help me?
    Arian

    PS I can creat new DBs with no problems

  4. #4
    Registered User
    Join Date
    Nov 2003
    Posts
    177
    I forgot to say I have just one user defied on my PC
    ANd I work as an Administrator

  5. #5
    Registered User
    Join Date
    Nov 2003
    Posts
    177
    Hi

    some body told me:
    1- open User Account Control Setting page
    2- put it on "Never notify"
    3- Restart the PC
    4- Open SQL server page and attch the DBs
    5- reset the User Account Control Setting

    AND Thank God that it works

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Secure Login Verification Problems
    By colloq in forum C# Programming
    Replies: 0
    Last Post: 12-11-2009, 08:16 AM
  2. [C#] MySQl database problems
    By Jelte in forum C# Programming
    Replies: 5
    Last Post: 09-26-2008, 04:11 AM
  3. delete problems visual 2008
    By what3v3r in forum C++ Programming
    Replies: 4
    Last Post: 10-31-2007, 09:35 PM
  4. Visual Studio Express 2008 problems.
    By Normac in forum C++ Programming
    Replies: 2
    Last Post: 08-08-2007, 11:41 AM
  5. Can I get this to loop back?
    By Unregistered in forum C Programming
    Replies: 9
    Last Post: 05-07-2002, 04:34 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21