SQLDMO Question

  • 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!!!

  • This was removed by the editor as SPAM

  • You could rename the existing .bak first.

    then if the new bak creates successfully, delete the one you renamed.

    ---------------------------------------
    elsasoft.org

  • 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