|
Private sub qryGongzi()
dim str as string
dim rstSql as new adodb.recordset
dim rstGz as new adodb.recordset
dim cnn as new adodb.connection
set cnn=currentproject.connection
rst.open "select * from 工资项目表 where 是否打印=true order by 序号",cnn
with rstSql
str="select "
do while not .eof
if not isnull(!计算公式) then
str=str & !计算公式 & " as " & !项目名称
else
str=str & !项目代码 & " as " & !项目名称
endif
.movenext
if not (.eof or .bof) then
str=str & ","
else
exit do
endif
loop
.close
end with
rstGz.open str,cnn
|
|