vb升级到vb.net后出错
我使用 Visual Basic 将我的项目升级到 vb.net。运行水晶报告时出现错误。
Call ReportConnection(CInspAuditList, "A")
CInspAuditList.ReportFileName = My.Application.Info.DirectoryPath & "\A.rpt"
Call SubReportConnection(CInspAuditList, "A")
CInspAuditList.set_ParameterFields(0, temp1)
CInspAuditList.set_ParameterFields(1, temp2)
CInspAuditList.set_ParameterFields(2, temp3)
CInspAuditList.set_ParameterFields(3, temp4)
CInspAuditList.Action = 1
我的连接是
Public Function ReportConnection(ByRef CrystalReport1 As Object, ByRef dsnname As String) As Boolean
Try
CrystalReport1.Connect = "dsn=" & dsnname & ";UID=" & gstrID & ";PWD=" & gstrPassword & ";DSQ="
Catch ex As Exception
MsgBox(ex.ToString)
End
End Try
End Function
Public Function SubReportConnection(ByRef CrystalReport1 As Object, ByRef dsnname As String) As Object
Dim NReport As Short
With CrystalReport1
NReport = .GetNSubreports
Do While NReport > 0
.SubreportToChange = .GetNthSubreportName(NReport - 1)
.Connect = "dsn=" & dsnname & ";UID=" & gstrID & ";PWD=" & gstrPassword & ";DSQ="
.SubreportToChange = ""
NReport = NReport - 1
Loop
End With
End Function
处收到错误 Exception from HRESULT: 0x800A501B
我在 CInspAuditList.Action = 1
我可以知道如何修复错误吗???
i upgrade my project to vb.net by using visual basic. i get a error when run the crystal report.
Call ReportConnection(CInspAuditList, "A")
CInspAuditList.ReportFileName = My.Application.Info.DirectoryPath & "\A.rpt"
Call SubReportConnection(CInspAuditList, "A")
CInspAuditList.set_ParameterFields(0, temp1)
CInspAuditList.set_ParameterFields(1, temp2)
CInspAuditList.set_ParameterFields(2, temp3)
CInspAuditList.set_ParameterFields(3, temp4)
CInspAuditList.Action = 1
my connection is
Public Function ReportConnection(ByRef CrystalReport1 As Object, ByRef dsnname As String) As Boolean
Try
CrystalReport1.Connect = "dsn=" & dsnname & ";UID=" & gstrID & ";PWD=" & gstrPassword & ";DSQ="
Catch ex As Exception
MsgBox(ex.ToString)
End
End Try
End Function
Public Function SubReportConnection(ByRef CrystalReport1 As Object, ByRef dsnname As String) As Object
Dim NReport As Short
With CrystalReport1
NReport = .GetNSubreports
Do While NReport > 0
.SubreportToChange = .GetNthSubreportName(NReport - 1)
.Connect = "dsn=" & dsnname & ";UID=" & gstrID & ";PWD=" & gstrPassword & ";DSQ="
.SubreportToChange = ""
NReport = NReport - 1
Loop
End With
End Function
i get error Exception from HRESULT: 0x800A501B
at CInspAuditList.Action = 1
may i know how to fix the error???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论