你的代码:
“
for intyear=year11 to year12
stryear=response.write(intyear)
strsql="select * from " + stryear +" where pb='01' "
objrs.open strsql,strdbdsn,3,3,1
next
”
表示按照年份有不同的表格,从而从不同年份的表格中取出数据,是这样吗?
改为下面的试试:
“
for intyear=year11 to year12
stryear=response.write(intyear)
strsql="select * from " & stryear & " where pb='01' "
objrs.open strsql,strdbdsn,3,3,1
objrs.close
next
”
这个是等效的
现改为如下:
for intyear=year11 to year12
stryear=response.write(intyear)
strsql="select * from" + stryear +" where pb='01' "
objrs.open strsql,strdbdsn,3,3,1
next
这个时候上面所说的问题是解决了,可是在打开的时候提示:
[Microsoft][ODBC Microsoft Access 驱动程序] Syntax error in FROM clause
我想我一次一次具有不同的strsql语句,那我就将不同的strsql语句打开一次objrs就执行一次总可以了吧
没想把“objrs.open strsql,strdbdsn,3,3,1”放在循环的里面也不可以:(
怎么办那!?