Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
error about sql server 2005 , why can't backup to c:\
Old 09-23-2008, 06:42 AM error about sql server 2005 , why can't backup to c:\
Experienced Talker

Posts: 34
Name: lung
Trades: 0
this is code:
Dim strSQL As String
Dim strCon As String
strCon = "Data Source=NITHI;Initial Catalog=master;Integrated Security=True"
Dim cmdBackup As SqlClient.SqlCommand = New SqlClient.SqlCommand


Cursor = Cursors.WaitCursor
Try
strSQL = "BACKUP DATABASE Northwind "
strSQL &= "TO DISK = 'G:\mybackup.bak' "
strSQL &= "WITH FORMAT, "
strSQL &= "NAME = 'myBackup'"
cmdBackup.Connection = conn

cmdBackup.CommandText = strSQL
cmdBackup.ExecuteNonQuery()
MsgBox("finish")
Catch ex As Exception
MsgBox("Error")
End Try


if i back up to G:\ ,it is Ok
but when i backup to C:\ ,it's not OK
what happen?

(about my computer)
i have 2 harddisk
partition G is slave harddisk
and partition C is master harddisk


this is error: "Cannot open backup device 'C:\mybackup.bak'. Operating system error 5(error not found).
BACKUP DATABASE is terminating abnormally."


please help me
lung is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-23-2008, 06:56 AM Re: error about sql server 2005 , why can't backup to c:\
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The SQL user probably doesn't have permissions to access "C:" drive.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-23-2008, 01:51 PM Re: error about sql server 2005 , why can't backup to c:\
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Without access to the machine, it's impossible to say. It could be an ACL, as Chris suggested. It could be filespace. It could be any number of things. You'll have to put on your debugging hat.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 09-23-2008, 11:02 PM Re: error about sql server 2005 , why can't backup to c:\
Experienced Talker

Posts: 34
Name: lung
Trades: 0
and i can only restore form C:\program file\microsoft sql server\mssql1\mssql\backup\....

what's happen?
lung is offline
Reply With Quote
View Public Profile
 
Old 09-24-2008, 03:04 PM Re: error about sql server 2005 , why can't backup to c:\
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Mail me your server and I'll tell you. Otherwise, you're going to have to research the error.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 09-24-2008, 05:45 PM Re: error about sql server 2005 , why can't backup to c:\
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Bubble wrap the hard drives first though
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-24-2008, 05:53 PM Re: error about sql server 2005 , why can't backup to c:\
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Probably a very good idea, as Chris suggests.

FYI, the root directory on the CEE drive (aka C:\) is protected in some versions of Windows, particularly server installations. That protection applies to the folder, not the drive. So, being able to write a file to a particular folder, buried deep under the root, doesn't say anything about whether or not you're allowed to write to the root folder itself. An ACL (that's access control list, part of NTFS permissions) may be preventing the user account the SQL backup is running under from writing here.

To see whether or not that's the problem, debugging 101 suggests you try using code to write a small (or even empty) file to the root folder in C:\. If that works, figure out what account the backup is running under (NETWORK SERVICE?) and test their privs to the root folder on CEE.

I'm guessing that's the problem, but there are many possible causes. If you're being paid to develop software, you really need to understand the very basics and figure out how to debug the programs you write.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 09-28-2008, 10:11 PM Re: error about sql server 2005 , why can't backup to c:\
Experienced Talker

Posts: 34
Name: lung
Trades: 0
first step ,what should i do?
lung is offline
Reply With Quote
View Public Profile
 
Old 09-29-2008, 06:45 PM Re: error about sql server 2005 , why can't backup to c:\
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Read the manual?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 09-30-2008, 06:14 AM Re: error about sql server 2005 , why can't backup to c:\
Experienced Talker

Posts: 34
Name: lung
Trades: 0
i don't have manual.
i don't have book about SQL server
i only have Book about vb.net with SQL server

i have to know use SQL server
my english isn't good

i'm sorry if you don't understand what i say
lung is offline
Reply With Quote
View Public Profile
 
Old 09-30-2008, 02:41 PM Re: error about sql server 2005 , why can't backup to c:\
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
It's not a SQL Server error. It's with Windows, or your network. Look into the NTFS permissions on C:\.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 09-30-2008, 10:21 PM Re: error about sql server 2005 , why can't backup to c:\
Experienced Talker

Posts: 34
Name: lung
Trades: 0
about my program.

if my problem happen by windows.

It's difficult for write program.

of cause, my program can't use backup and restore cause
i restore only from c:\.....\sql server\backup
but i can only backup to G:\..

oh..! my sql server is version preview.
lung is offline
Reply With Quote
View Public Profile
 
Old 10-01-2008, 03:35 PM Re: error about sql server 2005 , why can't backup to c:\
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
If SQL Server is able to read and write backups to other locations, like the G drive and Program Files under C, then the problem isn't with SQL. It doesn't matter whether you have the time limited preview or enterprise edition. Windows isn't giving SQL permission to write to the root folder of the C drive. You can either put your backup somewhere else, or grant permission.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 10-02-2008, 10:05 PM Re: error about sql server 2005 , why can't backup to c:\
Experienced Talker

Posts: 34
Name: lung
Trades: 0
install new version of windows XP?
lung is offline
Reply With Quote
View Public Profile
 
Old 10-03-2008, 02:14 PM Re: error about sql server 2005 , why can't backup to c:\
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
No, it will be the same as the current version you have. The answer was already given, I don't understand why you refuse to take advantage of it. But you can do all kinds of things that don't address the problem, and still not solve it.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to error about sql server 2005 , why can't backup to c:\
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45526 seconds with 12 queries