Hello all,
I'm trying to create a recordset from a tab in a workbook that's been saved on a server drive. Part of the server path has a single quote which causes an issue when I try and pass my SQL statement for the recordset as a single quote denotes the start of a field (column) in SQL. When I replace the single quote with double quotes (as I've done with fields before) the connection then fails as the code correctly says the path doesn't exist.
I've tried to use the Command function but as the headings are not in Row 1 that doesn't work as it doesn't support [Fn] referencing.
If the connection string could just be the workbook name (it is open) it would work but it needs the workbook's full name, so back to the original issue.
Does anyone have any ideas how I could make this work?
Thanks in advance,
Robert
I'm trying to create a recordset from a tab in a workbook that's been saved on a server drive. Part of the server path has a single quote which causes an issue when I try and pass my SQL statement for the recordset as a single quote denotes the start of a field (column) in SQL. When I replace the single quote with double quotes (as I've done with fields before) the connection then fails as the code correctly says the path doesn't exist.
I've tried to use the Command function but as the headings are not in Row 1 that doesn't work as it doesn't support [Fn] referencing.
If the connection string could just be the workbook name (it is open) it would work but it needs the workbook's full name, so back to the original issue.
Does anyone have any ideas how I could make this work?
Thanks in advance,
Robert