I am trying to execute an SQL statement to a MS Access database, using a variable obtained from an Environmental variable Query String. The page the script is started from is a dynamically built page of data retrieved by another script. The two execute statements seem to be almost the same (excepting variables) to my eyes, but one works and the other doesn't. The error message returned is as follows;

The actual select statement (Excuse me for not showing it all) contains almost forty elements. I had miss-typed one element in the SELECT statement, and by adding one extra letter, the error message returned with "expected 7" (see above) where before it had been "Expected 6".

This is a very frustrating problem as I cannot see what is being done incorrectly even though I compare it to the previous example I have that works.

This is hard to diagnose without the complete select statement. The error message suggests that you're not supplying the right number of bindings for placeholders in the query, but your select shows one placeholder and one bound value.

Are you really listing tables as xxxx and then says x.dd instead of xxxx.dd?

Could 'Pool/Spa' and 'Aircon/Heating' be part of the problem? Access (stupidly) allows slashes in field names, though they might be mistaken for division by some other part of the pipeline. What happens if you take those out of the query?