ADO记录集EOF和BOF与预期不符

时间:2012-01-09 15:05:04

标签: asp-classic vbscript

arrBand = array("6M","10M","12M","15M","17M","20M","30M","40M","60M","80M","160M")

存储过程是

SELECT * 
FROM tableBand
WHERE UCall=[In_Call] And ACID=[In_CID] and BAND=[In_Band];

以下代码始终执行“not”条件。对于给定的CRS(“CID”),数据库中只有2行具有一个数组值,即6M和10M。

for i = 0 to UBound(arrBand)
  ConnTemp.GetMode SanCall, CRS("Cid"), arrBand(i), BandRS
  if not BandRS.EOF and not BandRS.BOF then
    tmp = tmp + "<td style='width: 59px;'>" + arrBand(i) + "<input name='Ck'" +     arrBand(i) + "' type='checkbox' checked='checked'value='Y'/></td>"
  else
   tmp = tmp + "<td style='width: 59px;'>" + arrBand(i) + "<input name='Ck'" + arrBand(i) + "' type='checkbox'/></td>"
end if
BandRS.close
next

1 个答案:

答案 0 :(得分:0)

事实证明,字段名称“Band”是一个保留字,即使查询在Access中运行也是如此。我把它改成了Bandx,它现在正在工作。