我一直在尝试使用以下Visual Basic代码浏览基于SQL Server数据库的Crystal Reports版本8:
CrystalReport1.ReportFileName = "C:\Report1.rpt"
CrystalReport1.Destination = crptToWindow
CrystalReport1.DiscardSavedData = True
CrystalReport1.WindowState = crptMaximized
MsgBox "Ok!", vbInformation
CrystalReport1.Action = 1
我正在使用Crystal Reports控件。报告的数据库是ODBC datasource
连接到SQL Server。没有DiscardSavedData
这可行,但它显示旧数据。使用DiscardSavedData
,我收到错误消息:
- 错误20599无法打开SQL Server。
如何解决这个问题?