Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Tuesday, March 27, 2012

Backup failed (Error 3041) while try to issue a BACKUP Statement in Local

Hi,

I use the Transact-SQL BACKUP statement in Visual Basic to backup my local MSSQL Database. It give me this error

Error 3041

BACKUP failed to complete the command BACKUP DATABASE [BCFPC] to BCFPCBKP

I already created a backup device called BCFPCBKP and it is backup to the disk.

I tried to run the same BACKUP statement in SQL Query Analyzer and it worked fine. I tried to run my VB application in another PC. It worked fine when i use this command remotely. Can anyone tell me what's the problem?

Thanks in advance

regards,
M.Y. YapAre you sure the id which was used to start the job agent had access right to the backup device?|||Yes, I usse the same id with the one that I used at a remote PC.

The id I used was 'sa' and I connect to the master database to run the 'BACKUP' statement.

Saturday, February 25, 2012

Backup and restore database from local drive to hosting server

Hello all,

I'm new to SQL server and I've just seutp a website using the new Visual Web Developer and SQL 2005 Express. I've got my website out on the hosting site server but I need to copy my database file to the hosting site's sql 2005 server. I asked my provider how to do this and they advised to use SQL Server Mgmt Stuido and to perform a backup of my local database file and then do a restore to their server. First they said to create a database on their server using a web based control panel provided with the site controls (this would be a temporary database overwritten by my local copy on the restore - I'm assuming). Then I could do my backup and restore.

I've not been successful doing this. I can connect to their server and my temporary database and can also backup my local database. I cannot, however see how to restore my backup copy to the remote site's sql server. When I choose to restore a database on the remote site, I am only provided with a file browser with folders the SQL Server instance can see. These obviously are not any of my local files so I can't use my local backup. I can't backup my file directly to the server because of the same issue, my local SQL instance can only see my local files, not the remote site directories.

I am probably overlooking something obvious but I really could use any input offered.

Thanks in advance for any help.

Regards,
Scott

Hi all:

Update to this issue, I finally resolved it. I just decided to recreate the database manually on the server using scripts. I connected in SQL Server Mgmt Studio to my remote db server and ran all the scripts I created from my local database. This took a while but I was able to finally get it finished and it now works great.

Sunday, February 19, 2012

Backup a Database

I want to be able to Backup a SQL Server 2005 Database from Visual Basic 2005. I'm looking for help here, as I have searched online and no luck.
ThanksEasy way - construct a SQL statement (see BACKUP DATABASE in books online for syntax) and submit that to the SQL Server for execution.
Still easy but I've never used - try using the SMO object model.

Easiest of all - have your server back itself up rather than rely on an external application.|||I want to be able to Backup a SQL Server 2005 Database from Visual Basic 2005. I'm looking for help here, as I have searched online and no luck.

Thanks

Ask your DBA