一个关于VB报表打印的问题,请各位指教
我用 DataEnvironment 与 datareport 来实现报表打印建立连接Connection1 与命令Command1 连接D:\工程\building数据库下的T_Buildingrecondition表
Connection1建立连接测试成功,可执行打印按钮时总是提示无效数据源 请各位帮帮忙吧
打印按钮代码如下
If DataEnvironment1.rsCommand1.State = adStateOpen Then
DataEnvironment1.rsCommand1.Close
End If
DataEnvironment1.rsCommand1.Open "select * from T_Buildingrecondition where 房产证号 between '" + Text1.Text + "' and '" + Text2.Text + "'"
If DataEnvironment1.rsCommand1.RecordCount > 0 Then
DataReport1.Show 1
Else
MsgBox "此段没有记录,请重新选择!", vbOKOnly, "提示"
DataEnvironment1.rsCommand1.Close
End If
[此贴子已经被作者于2005-12-23 9:39:57编辑过]