Forum Discussion
Hi Abhi,
A quick question: does the query return data?
(If I remember it correctly, in case of absent data, both .EOF and .BOF equal to true)
- Adagio8 years agoFrequent Contributor
Hi Alex,
Yes, the query returns the data( 1 row), but not sure why it fails at MoveFirst()
Thank you
Abhi
- AlexKaras8 years agoCommunity Hero
Hi Abhi,
Then, most probably, the conn.Execute_(execQuery); line returns forward-only recordset (I used to use plain ADO objects and explicitly specify recordset parameters).
If this is the case, then you should just omit the call to .MoveFirst().
Note, that in case of forward-only recordset it is not possible to rewind it and you must close and re-open it if you need another iteration.
- Adagio8 years agoFrequent Contributor
Hi Alex,
I found out the reason. It's because of just one field in the SQL query which is returning a NULL value. The query had 100 different fields, and I had to check every one of those. Just one field which is highlighted below is causing this issue.
Could you please suggest if there's any way to avoid this problem?
SELECT CASE WHEN CSTHNK > 80 THEN '19' CONCAT CSTHNK ELSE '20' CONCAT CSTHNK END as F74_CSTHNK_ThnkYouNoteSentYr_Conv, BYTSK,
MGPORM,
PRMCSK,
TSHIKOG
FROM CUSMAS WHERE CSCSNR = 1482Thank you
Abhi