Cutting and pasting the query to my Access gives a syntax error at the 'IS' statement. When I remove it (...TEXT LIKE '*H*'...) the query executes just fine.
The fact that you don't get an error when you populate the recordset indicates that the query you run simply does not return any records.
I would check the query itself, so that you are not querying the wrong table, fields etc.
SQL = "SELECT COD FROM DESCRIPTION WHERE TEXTO LIKE '*H*'
(JUST ONE TABLE WITH COD (STRING), TEXTO (STRING) AND SITUATION(BYTE)
CN.Open STRCON
RS.Open SQL, CN
IF RS.EOF AND RS.BOF THEN ..... (ARE ALWAYS TRUE)
THE SQL QUESTION WORKS CORRECTLY USING DAO:
SET DB=OPENDATABASE(DBPATH)
SET RS=DB.OPENRECORDSET(SQL)
(IN THIS CASE RS.RECORDCOUNT IS 155). (I KNOW WITH THE SENTENCES IN ADO I'M GETTING JUST THE FIRST RECORD)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.