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

The stored proc is

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

The following code always executes the "not" condition. For a given CRS("CID") there are only 2 rows in the database that have one of the array values, i.e. 6M and 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
8
  • Without seeing your table data and the exact SQL statement being executed, it's hard to help. Jan 9, 2012 at 15:17
  • The exact SQL statement is in the post. The table contains 3 columns, ACID, UCall, Band, all text. The data in row 1 is 1A0, nf4l, 6M. In row 2 it's 1A0, NF4L, 10M.
    – Mike
    Jan 9, 2012 at 15:48
  • are you sure data is being returned and no errors are occurring?
    – Robert
    Jan 9, 2012 at 16:36
  • Redfaced, I now see I was calling the wrong proc, should have been getBand. Having corrected that, now I get: Syntax error (missing operator) in query expression 'UCall=[In_Call] And ACID=[In_CID] and BAND=[In_Band]'.
    – Mike
    Jan 9, 2012 at 17:19
  • The query runs perfectly in Access.
    – Mike
    Jan 9, 2012 at 18:25

1 Answer 1

0

It turns out that the field name "Band" is a reserved word, even tho the query ran in Access itself. I changed it to Bandx, and it's now working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.