| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1281 人关注过本帖
标题:数据库备份问题
只看楼主 加入收藏
fsx
Rank: 1
来 自:广西南宁
等 级:新手上路
帖 子:278
专家分:0
注 册:2005-11-9
结帖率:100%
收藏
 问题点数:0 回复次数:1 
数据库备份问题
各位大哥各大姐,帮帮小弟吧~我没辄了!
问题如下:
做一个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]]
搜索更多相关主题的帖子: 数据库 
2008-10-18 11:52
fsx
Rank: 1
来 自:广西南宁
等 级:新手上路
帖 子:278
专家分:0
注 册:2005-11-9
收藏
得分:0 
可能图片看不清,我把错误代码贴出来。请各位帮看看。
Server Error in '/' Application.--------------------------------------------------------------------------------

[bo]Retrieving the COM class factory for component with CLSID {10021F00-E260-11CF-AE68-00AA004A34D5} failed due to the following error: 80070005.[/bo]
[bo]Description:[/bo] An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

[bo]Exception Details:[/bo] System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {10021F00-E260-11CF-AE68-00AA004A34D5} failed due to the following error: 80070005.

is not authorized to access the requested resource. Consider granting access rights to the resource to the request identity. has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the account, and check the boxes for the desired access.

[bo]Source Error: [/bo]


Line 37:         public static void SQLBACK(string ServerIP, string LoginName, string LoginPass, string DBName, string BackPath)
Line 38:         {
Line 39:             SQLDMO.Backup oBackup = new SQLDMO.BackupClass();
Line 40:             SQLDMO.SQLServer oSQLServer = new SQLDMO.SQLServerClass();
Line 41:             try
 

Source File: d:\wwwroot\rencaiwang\web\App_Code\BLL\DataBak.cs    Line: 39

[[it] 本帖最后由 fsx 于 2008-10-18 15:34 编辑 [/it]]

做你喜欢做的事
2008-10-18 15:31
快速回复:数据库备份问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027285 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved