I am attempting to specify a filter condition on an ADO Recordset where one of the field names contains both left and right square brackets as part of the name. The resulting condition string is being assigned to the Recordset's Filter property so as to subset the data returned from the Recordset.
If the field name is "First Name" then simply enclosing the field name in square brackets works fine. For example:
recSet.Filter = "[First Name] = 'Tony'";
However, for a field name such as "Height [cm]" I have not been able to determine how to quote the square brackets within the field name. After searching the internet, things I have tried are:
recSet.Filter = "[Height [[]cm[]]] > 156";
recSet.Filter = "[Height [cm[]]] > 156";
But neither of these work.
Any suggestions on the correct way to handle such names?
Thanks, David.
BTW, I have no control over the names in the data tables being accessed.
Aucun commentaire:
Enregistrer un commentaire