数据库备份问题
各位大哥各大姐,帮帮小弟吧~我没辄了!问题如下:
做一个SQL Server数据库备份问题,在bin中已经引用了Interop.SQLDMO.dll,Interop.ADODB.dll,Interop.ADOX.dll,Interop.JRO.dll这四个文件了,在本地测试是可以备份的,但传到服务器上就提示错误,请问该如何解决,在此谢谢了!
出错代码如下:
下面是备份的主要代码
public static void SQLBACK(string ServerIP, string LoginName, string LoginPass, string DBName, string BackPath)
{
SQLDMO.Backup oBackup = new SQLDMO.BackupClass();
SQLDMO.SQLServer oSQLServer = new SQLDMO.SQLServerClass();
try
{
oSQLServer.LoginSecure = false;
oSQLServer.Connect(ServerIP, LoginName, LoginPass);
oBackup.Action = SQLDMO.SQLDMO_BACKUP_TYPE.SQLDMOBackup_Database;
oBackup.Database = DBName;
oBackup.Files = BackPath;
oBackup.BackupSetName = DBName;
oBackup.BackupSetDescription = "数据库备份";
oBackup.Initialize = true;
oBackup.SQLBackup(oSQLServer);
}
catch (Exception e)
{
throw new Exception(e.ToString());
}
finally
{
oSQLServer.DisConnect();
}
}
[[it] 本帖最后由 fsx 于 2008-10-18 11:53 编辑 [/it]]