| Author |
Topic  |
|
|
Mamatha
Posting Yak Master
Iceland
102 Posts |
Posted - 12/22/2004 : 07:52:42
|
Hi
I want to restore SQL Server 2000 backup file using ASP.I have a code to restore but it gives errors like
"Microsoft SQL-DMO (ODBC SQLState: 42000) (0x800A0C81) [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open backup device 'd:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\backupi.BAK'. Device error or device off-line. See the SQL Server error log for more details. [Microsoft][ODBC SQL Server Driver][SQL Server]RESTORE DATABASE is terminating abnormally. /Intranet/ex3.asp, line 28"
The code is :
"<% Set srv=Server.CreateObject("SQLDMO.SQLServer") srv.Connect "server", "sa", "thanks" Set rest=Server.CreateObject("SQLDMO.Restore") rest.Action=0 ' full db restore rest.Database="Arizona" rest.Devices=Files rest.Files ="\\server\D\Program Files\Microsoft SQL Server\MSSQL\BACKUP\backup1. BAK" rest.ReplaceDatabase=True 'Force restore over existing database rest.SQLRestore(srv) response.write "Done!" set rest=nothing set srv=nothing %>
What is the problem?why it gave errors like that..Please give me the solution.This is very urget need for me.
Many thanks in advance
Mamatha
Mamatha |
|
|
tkizer
Almighty SQL Goddess
USA
35007 Posts |
Posted - 12/22/2004 : 15:04:28
|
Well, does this path work from the database server:
\\server\D\Program Files\Microsoft SQL Server\MSSQL\BACKUP\backup1. BAK
???
Must be a valid path from the database server as that's where the BACKUP command runs and not from your client machine.
Tara |
 |
|
|
Mamatha
Posting Yak Master
Iceland
102 Posts |
Posted - 12/23/2004 : 00:29:33
|
Hi tduggan
Thanks for your reply.I used path like "D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\backup1.BAK" and executed on the server, but i got the same error.What is the problem?Please give me the solution.
Mamatha
Mamatha |
 |
|
|
nr
SQLTeam MVY
United Kingdom
12543 Posts |
Posted - 12/23/2004 : 02:15:57
|
The path doesn't exist or the sql server account doesn't have access to it.
try executing master..xp_cmdshell 'dir \\server\D\"Program Files"\"Microsoft SQL Server"\MSSQL\BACKUP\backup1. BAK'
========================================== Cursors are useful if you don't know sql. DTS can be used in a similar way. Beer is not cold and it isn't fizzy. |
Edited by - nr on 12/23/2004 02:17:12 |
 |
|
|
tkizer
Almighty SQL Goddess
USA
35007 Posts |
Posted - 12/23/2004 : 12:12:31
|
Did you see if that is a valid path through Windows Explorer on the database server?
Tara |
 |
|
|
anurag0583
Starting Member
India
1 Posts |
Posted - 12/03/2008 : 03:22:38
|
Hi,
The solution is to place the file path between square brackets like "[C:\Program Files\Microsoft SQL Server\80\MSSQL\Backup\pubs.bak]" instead of using "C:\Program Files\Microsoft SQL Server\80\MSSQL\Backup\pubs.bak"
So, in your case, you should keep your file path as
"[\\server\D\Program Files\Microsoft SQL Server\MSSQL\BACKUP\backup1. BAK]"
This will work fine.
Regards, Anurag Srivastava http://www.aprajita.com
|
 |
|
|
tkizer
Almighty SQL Goddess
USA
35007 Posts |
|
|
migro
Starting Member
1 Posts |
Posted - 08/13/2009 : 19:30:38
|
| Because other people might profit from the information? |
 |
|
|
Irwin
Starting Member
Czech Republic
1 Posts |
Posted - 01/06/2010 : 09:38:00
|
Hi, we use Tivoli for sql server backup. When I was trying to back up DBs from one of 3 instances (migrated from sql server 7.) I got such error:
ACO5422E Received the following from the MS SQL server: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open backup device '.....'. Operating system error 0x80070005(error not found). [Microsoft][ODBC SQL Server Driver][SQL Server]BACKUP DATABASE is terminating abnormally. Microsoft SQL-DMO (ODBC SQLState: 42000) (HRESULT:0x80040c81)
and I've find the next solution:
"...To work around the problem, use the TCP/IP Net-Library instead of the Named Pipes Net-Library to connect to the SQL Server database, and then back up or restore the database..." The problem was solved
For more: http://support.microsoft.com/kb/827452 |
 |
|
|
sebantom1979
Starting Member
6 Posts |
|
| |
Topic  |
|