试一下:
sm = "... "
rec1.open sm
if rec1.recordcount > 0 then ' if rec1.bof() or rec1.eof() then
...
endif
sm = "... "
rec1.open sm
if rec1.recordcount > 0 then ' if rec1.bof() or rec1.eof() then
...
endif
sm = "... "
rec1.open sm
if rec1.recordcount > 0 then ' if rec1.bof() or rec1.eof() then
...
endif
If rec1.State = adStateOpen Then rec1.Close
否则一执行rec1.open语句就提示错误.