请教各位高手,我在做生成报表的时候,第一次有报表的预览,但是第二次点“生成报表”按钮的时候,会有“从当前数据资源中取得行值失败”这个错误。
“生成报表”按钮代码如下:
q_string2 = "DB_" & Trim(Combo1.Text) & "年" & Trim(Combo2.Text) & "月" & Trim(Combo3.Text) & "日"If DataEnvironment1.Connections("Connection1").State = adStateOpen Then
DataEnvironment1.Connections("Connection1").Close
End If
DataEnvironment1.Connections("Connection1").ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=czwd2006;Data Source=LEGEND-OPYHDARR"
DataEnvironment1.Commands("command1").CommandType = adCmdTable
DataEnvironment1.Commands("command1").CommandText = q_string2
If DataEnvironment1.rsCommand1.State = adStateOpen Then
DataEnvironment1.rsCommand1.Close
End If
DataReport1.Show
请高手帮忙看看,该怎么改?谢谢!