MSDE: sp_attach_db gives osql 'device activation error

Posted on 2005-05-12
Last Modified: 2008-01-09

I have a properly detached databasefile db.mdf and db.ldf copied to a cliënt computer wich has MSDE installed. When i try to attach this database in MSDE, i get the following error:

Msg 5105, Level 16, State 2, Server PC_LIEVE\TAAKOVERZICHT, Line 1
Device activation error. The physical file name 'D:\MSDETest\Taakoverzicht.MDF'
may be incorrect.

The file exists in the specified location, security is everyone permitted. What can be the cause of this?
Question by:Droezel

    Author Comment

    1> EXEC sp_attach_db @dbname= N'Taakoverzicht', @filename1 = N'D:\MSDETest\Taako
    verzicht_Data.MDF', @filename2 = N'D:\MSDETest\Taakoverzicht_Log.ldf'
    2> GO

    This is the command being used.
    LVL 19

    Expert Comment

    by:Melih SARICA
    check filenames of the Files u gave a filename parameters

    Author Comment

    These are the filenames, copied right out of explorer:


    they are identical (believe me, i checked like 2500 times), permission on the folder = everyone - full control
    I also log on using the administrator (sa) account with the following command:

    osql -SLAPPIELIEVE\Taakoverzicht -Usa -PTOAdmin

    And I still get the same error:
    Msg 5105, Level 16, State 4, Server LAPPIELIEVE\TAAKOVERZICHT, Line 1
    Device activation error. The physical file name
    'D:\MSDETest\Taakoverzicht_Data.MDF' may be incorrect.

    I have really no idea what's wrong here.

    Is there maybe another way to attach a database from some kind of script or command?

    LVL 28

    Accepted Solution

    Can you try this if it will make any difference:

    EXEC sp_attach_single_file_db @dbname = N'Taakoverzicht',
       @physname = 'D:\MSDETest\Taakoverzicht_Data.MDF'

    Author Comment

    I found that the problem was that another sql server instance was running. When I stop that server, the attach works
    LVL 19

    Expert Comment

    by:Melih SARICA
    i guess these databases r being used by other SQL Server Instance.. U ave the same databases on the other Instance..

    Melih SARICA

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    Via a live example, show how to shrink a transaction log file down to a reasonable size.
    Viewers will learn how the fundamental information of how to create a table.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now