delete failure on backup device, Access is denied.

I can't figure out why I am getting an access denied error. The file does not seem to be in use.

I tried to drop my database and get this error:

 AsynchronousDiskAction::DoDeleteFile: delete failure on backup device 'C:\Program Files\Datalink\SFS\SqlServer\SFS_ISLAND_20060501.ldf'. Operating system error 5(Access is denied.).

The database is dropped from sysdatabases, but the physical files are still there.

LVL 4
brokeMyLegBikingAsked:
Who is Participating?
 
Aneesh RetnakaranDatabase AdministratorCommented:
Hi brokeMyLegBiking,
Make sure that the user has enough permission to delete the files from the physical directory

Aneesh R!
0
 
SweatCoderCommented:
are you using DROP DATABASE syntax?

>> The database is dropped from sysdatabases

?? you mean dropped when "master" is current db?
0
 
brokeMyLegBikingAuthor Commented:
how can I check that?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
brokeMyLegBikingAuthor Commented:
sweatCoder, yes, master DB is current DB. I am executing the command from a VB.NET windows application.
0
 
SweatCoderCommented:
per aneeshattingal, make sure the user that runs mssql has write permissions on that ldf file and on the folder.
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
Easiest way is to goto
C:\Program Files\Datalink\SFS\SqlServer\
try to delete the log file . watch the error message ..
0
 
SweatCoderCommented:
aneeshattingal, your experiment is only worthwhile if the logged in user is the same as the user context that mssql runs under. they are often not the same. just because the logged in user can delete a file doesn't mean mssql can.
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
You are Right SweatCoder. If he uses the windows Authentication, then the above strategy  will work
0
 
brokeMyLegBikingAuthor Commented:
OK, I think we are on to something.

When I connect to my database using windows authentication, I have no problem, but when I attach using the sa login (which is what my application is using to connect to the DB) it has the problem...

hm, now I have to figure out how to grant read-write access to the sa login, for the directory:  C:\Program Files\Datalink\SFS\SqlServer\

I don't have this problem in sql Server 2005 developer edition, just express edition.

0
 
brokeMyLegBikingAuthor Commented:
correction : *but when I use the sa login
0
 
brokeMyLegBikingAuthor Commented:
Excellent!

Thanks for your help. This issue was really causing me some serious headaches.

To fix it I just have my program log in with windows authentication instead of using the sa login for any attach databse and drop databse commands.

-brokeMyLegBiking





0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.