小弟把sql查詢的筆數,放到datareport的textbox內,屬性datafield名為empno,執行結果卻告訴我「找不到資料欄empno」,請各位幫我檢查何處有問題?謝了~ ps.sql確定可跑
str1 = "select count(a.empno) from docbase a " & _
"left outer join emp b on a.empno=b.empno " & _
"where a.result='1' " & _
"group by b.empno " & _
"order by b.empno "
Set rs2 = New ADODB.Recordset
rs2.Fields.Append "count(a.empno)", adChar, 8
rs2.Open str1, cn
Set ExReport.DataSource = rs2
rs2.Cancel
Set rs2 = Nothing
ExReport.Show