October 13, 2006 at 3:00 am
I use the following C# code to backup my database
SQLDMO.SQLServer2Class srvBK = new SQLDMO.SQLServer2Class();
srvBK.Connect(strServerName,strUserName,strUserPassword);
SQLDMO.Backup2Class bak = new SQLDMO.Backup2Class();
bak.Initialize=true;
bak.Database = "MyDBName";
bak.Files = "D:\Test.bak";
srvBK.DisConnect();
bak.SQLBackup(srvBK);
if i backup second time, the backup add to existing file.
Is there any way to change backup option to overwrite existing backup file.pls help me!!!
October 16, 2006 at 8:00 am
This was removed by the editor as SPAM
October 19, 2006 at 5:28 pm
You could rename the existing .bak first.
then if the new bak creates successfully, delete the one you renamed.
---------------------------------------
elsasoft.org
January 12, 2007 at 2:44 pm
Did you set your Action to SQLDMOBackup_Database?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply