Syntax error in ASP code results page
I'm using the DataAssist 2 wizard for an old ASP website I have been asked to work on.
I'm getting a syntax error on the results page:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Company Name'.
/db-admin/tblRecommendedRetailers_Results.asp, line 67
I think this is due to the database field name containing spaces - I cannot change this unfortunately as the database is also used by my client.
Can anyone provide any suggestions as to how to go about fixing this issue? The problem is being caused in the WHERE clause too, when searching for records. I've attached a copy of my page in zip format to this post.
***** UPDATE - FIXED IT MYSELF *****
I found the problem, it was to do with the ORDER BY part of the SQL statement. I needed to add square brackets around the field [Company Name] in this part of the SQL query. That fixed it.