Hi guys,
nice to meet you All!

I am struggling with Excel, trying to get data from an .mdb Access old db,
via SQL query "only".

I mean "only", cause I am able to get what I need by "looping" through records without
errors, but I assume using SQL is extremely better!

So, code you will see below, is ok in order to get connected to the db and
I can easily get recordset content by looping,
but I did a lot of tentatives with queries you will see and
in no one case (you see only two here) I was able to run correctly the query
cause I always get "query sintax error" when executed.

Where is my error ?

To be clear in advance, I cannot use ADO or DAO to connect, cause this is a very old
db and also a very old xls with dozens of macros with the same kind
of connection method you see below.

Thank you in advance,

Private Function aggiorna_comm(stringa_connessione, valuex) As Boolean

On Error GoTo Err_aggiorna_comm

Dim db_destination As Database
Dim rs_destination As Recordset

Set db_destination = OpenDatabase(stringa_connessione)
Set rs_destination = db_destination.OpenRecordset(tabx)

strQry = "SELECT * FROM '" & tabx & "' WHERE '" & fieldx & "' = '" & valuex & "'"
strQry = "SELECT * FROM "&tabx&" WHERE "&fieldx&" = " & valuex & "' "

db_destination.Execute strQry

test = rs_destination!idComm

Set rs_destination = Nothing

Set db_destination = Nothing
Exit Function

MsgBox Error$
Resume Err_aggiorna_comm_exit

End Function