ADODB 3021 Error but there IS a record

D

Dom

I am opening a Recordset to use the items in a function however, everytime I
run the following code -

rsCalc.Open strSQL, CNSTRING, adOpenKeyset, adLockOptimistic
msgbox rsCalc!Item '(Just to see what's there)
Do Until rsCalc.EOF
str = xxx(rscalc!Item)
Loop

I get the 3021 error - Either BOF or EOF is True or the current record etc
etc.

Now, I know there are records as I've tested the SQL I pass in the Query
window and it has at 5 records.

I've checked everything I can think of and I'm now at a loss as to why I get
the error.

Any help would be greatly appreciated.

Dom
 
D

Dom

I just read the whole thread of the RecordCount = -1 post and I found Ken's
reply

Sorry... I so rarely use ADO that I overlooked the fact that it uses a
different wildcard than DAO.

Change * to % in your SQL string.
--
Ken Snell
<MS ACCESS MVP>

.....which was EXACTLY the problem...

Thanks Ken!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top