I have an Access 2003 database with some visual base code using ADO calls in it. When i do
strsql0 = "SELECT lnk_stockitm.C_C FROM lnk_stockitm WHERE (((lnk_stockitm.C_C) Like 'T*'));"
newRS.Open strsql0, cn1, adOpenKeyset, adLockReadOnly
newRS.movelast
I get this error:
3021 is either bof or eof true or the current record has been deleted
When I run the same query in the same function without a WHERE clause, for example:
strsql0 = "SELECT lnk_stockitm.C_C FROM lnk_stockitm;
I get the correct result from 56,000 entries. If I insert the full SQL statement into the WHERE clause in a regular query, for example:
SELECT lnk_stockitm.C_C FROM lnk_stockitm WHERE (((lnk_stockitm.C_C) Like 'T*'));
it returns the correct subset of results (2800 records).
Can someone tell me what I am doing wrong?
source
share