2011-06-10 60 views
1

我得到错误0x800A5077,我尝试导入CrystalActiveXReportViewerLib10CrystalReportsCommonObjectModelLib,但它仍然没有工作。

异常来自HRESULT:0x800A5077当执行水晶报告

Call ReportConnection(CInspAuditList, "Pab_Prod") 
     CInspAuditList.ReportFileName = My.Application.Info.DirectoryPath & "\MAuditList.rpt" 
     Call SubReportConnection(CInspAuditList, "Pab_Prod") 
     CInspAuditList.set_ParameterFields(0, "mchno; " & frmMachine.machine & " ;true") 
     CInspAuditList.set_ParameterFields(1, "batch; " & CDbl(frmMachine.batch) - 1 & " ;true") 
     CInspAuditList.set_ParameterFields(2, "Points; " & InpStdPt & " ;true") 
     CInspAuditList.set_ParameterFields(3, "ovrpt; " & OvrPoints & " ;true") 
     CInspAuditList.Action = 1 

发生错误时CInspAuditList.Action = 1

vb.net帮我申报CInspAuditList as AxCrystal.AxCrystalReport
这是我的连接功能:

Public Function ReportConnection(ByRef CrystalReport1 As AxCrystal.AxCrystalReport, ByRef dsnname As String) As Boolean 
     CrystalReport1.Connect = "dsn=" & dsnname & ";UID=" & gstrID & ";PWD=" & gstrPassword & ";DSQ=" 
    End Function 

我想知道原因的原因发生错误&我的连线是否正确

回答

0

发生在我身上的那是因为报告文件(.rpt)包含到数据库的连接,该数据库不存在或无法通过运行程序解决方案的计算机找到:打开报告文件( .rpt),菜单数据库,验证数据库,检查连接参数(我的sql连接),确定,你可以看到一个msg,表示数据库是最新的,ok,保存报告中的变化