建议引用对象。 我觉得这个大家都没问题。 问题是在下面的代码中没有设置对象变量
Dim Report As New GridppReport
report.detail grid.recordset.connectionstring='数据库连接字符串'
report.detail grid.recordset.querysql=" SQL语句"
修改成下面的代码就可以了。
Dim Report As New GridppReport
Report.ConnectionString='数据库连接字符串'
Report.QuerySQL=”SQL语句"