# 请问可以将程式中的变数传到DataReport中?

Posted by Fai on September 02, 1999 at 14:10:17:

大汉堡说:
"不过可以考虑再往前一层看,也就是DataEnvironment的Command,当使用SQL当做搜寻资料的方式时,自己加个栏
位上去,如select *,space(10) as NewFieldName from TableName 这时将锁定模式改为批次锁定,然后Load DataReport前
先Open Dataenvironment1.rsCommand,再由
While Not .EOF
.Fields("NewFieldName") = 欲指定之变数值
Wend
设定完后再Load DataReport
就可自定资料于DataReport上....."

我首先传入参数990799
DataEnvironment1.cmdTest "990799"
DataEnvironment1.rscmdTest.Open
DataEnvironment1.rscmdTest!SubTotalCost = "10000"
DataEnvironment1.rscmdTest.Update
DataEnvironment1.rscmdTest.Close
DataReport4.Show
但是出Error,请问我应怎样做?

Follow Ups:

- 我的方式是将资料暂写于Recordset内......(请看) 大汉堡 16:05:35 9/02/99 (0)