什么叫有做有参数的报表
我给你个思路:
1。报表处理的过程全部放在存储过程中,存储过程中可以设置参数的
2.vb中调用时用如下格式: set rs=cn.excute("excute 存储过程 " & 参数1
 &"," & 参数2)
3.如果参数是字符的就加单引号.如:
set rs=cn.excute("excute 存储过程 "' & 参数1 &"','" & 参数2 &"'")给分吧,我正需要专家分呢

解决方案 »

  1.   

    有一个取巧的办法在数据环境里面用 cmdText,也就是直接写SQL文的那种在条件处用一个特别符号代替比如这么写
    select * from table1 where id = '?'然后在程序中直接设置    strSQL = deFlightDB.Commands("cmdCfmPick_Grouping").CommandText
       
        strRes = Replace(strSQL, "?", sTmpDate)
     
       deFlightDB.Commands("cmdCfmPick_Grouping").CommandText = strRes
        
        ' Requery the DB to get the newest data
        deFlightDB.rscmdCfmPick_Grouping.Open
        Set report1.DataSource = deFlightDB-----------