Im using XL97 vba on NT 4 to implement a simple database based on text files. Using OLEDB text driver and everything is OK except when I try using the IN SQL keyword with certain filenames. For example
ado_data.open "select stock_name from stock.csv where _
stock_id in (select id from stock_lookup.csv)"
works fine, however if stock_lookup.csv is changed to
stock lookup.csv (ie with a space character in the middle)
I get an error message. Enclosing the filename in square brackets, single or double quotes does not work either. Same problem occurs if instead of a space the character is a tilda, dash and many others special characters. I know I can get around this by re-writing as a join or re-naming the file on the fly but does anyone know of if there's some kind of way of telling ADO to allow special characters in filenames so that I can use original code.
ado_data.open "select stock_name from stock.csv where _
stock_id in (select id from stock_lookup.csv)"
works fine, however if stock_lookup.csv is changed to
stock lookup.csv (ie with a space character in the middle)
I get an error message. Enclosing the filename in square brackets, single or double quotes does not work either. Same problem occurs if instead of a space the character is a tilda, dash and many others special characters. I know I can get around this by re-writing as a join or re-naming the file on the fly but does anyone know of if there's some kind of way of telling ADO to allow special characters in filenames so that I can use original code.