我用VB6.0来调用水晶报表,程序代码是这样的:FORM1中代码
Dim connstr As String
 If conn.State = adStateOpen Then conn.Close
   connstr = "driver=SQL Server;server=LIU;uid=sa;pwd=0414;database=ygzy"        
   conn.ConnectionString = connstr
   conn.Open
  conn.CursorLocation = adUseClient
  If rs.State = adStateOpen Then rs.Close
 rs.Open "ShouRu,DataEntry", conn, 3,1
Form2.Show 1       
End SubFORM2中代码
Dim oApp As New CRAXDRT.Application
Dim oRpt As CRAXDRT.Report
Dim reportName As String
'上面三行是新增加的
Screen.MousePointer = vbHourglass
reportName = "\Rpt\Report6.rpt"        '定义要引用的rpt文件
Set oRpt = oApp.OpenReport(App.Path & reportName, 1)
oRpt.Database.SetDataSource rs    '连接水晶报表和数据源
oRpt.ReadRecords
CRViewer91.ReportSource = oRpt  '启用水晶报表的预览功能
CRViewer91.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer91.Top = 0
CRViewer91.Left = 0
CRViewer91.Height = ScaleHeight
CRViewer91.Width = ScaleWidth
End Sub
Private Sub Form_Unload(Cancel As Integer)
  'Set Report = Nothing
    Set rs = Nothing
    Set conn = Nothing
    Unload Form2
    End Sub
对了,我还在Module1模块中声明了语句
Public conn As New ADODB.Connection
Public rs As New ADODB.Recordset我的报表Report6中的字段用了2个表“DataEntry”和“ShouRu”。所以我就用了rs.Open "ShouRu,DataEntry", conn, 3,1
就是打开2个表,可运行结果提示我未找到文件,我很郁闷,我把其他的报表拿来是可以用的,比如Report5,报表的子段只用一个表中取。语句为rs.Open "DataEntry", conn, 3,1,运行是正常的,我就觉的很郁闷,为啥报表中引入了2张表的就调不出来?各位大虾们救命啊!。