
Unable to connect using Visual FoxPro driver when quote is in path
I have a program that is working ok. I have a .dbf file that I am
trying to read using the following connection:
con.Open "driver=microsoft visual foxpro driver;sourcedb=" &
rstrDbLocation & ";sourcetype=dbf"
If there is a single quote in a folder in rstrDbLocation variable, the
program returns with the error
[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
ADO:Error #0:
ADO Error #-2147467259
Description [Microsoft][ODBC Driver Manager] Driver's
SQLSetConnectAttr failed
Source Microsoft OLE DB Provider for ODBC Drivers
SQLState IM006Error #1:
ADO Error #-2147467259
Description [Microsoft][ODBC Visual FoxPro Driver]SourceType
Source Microsoft OLE DB Provider for ODBC Drivers
SQLState 01S00
ADO:
Any ideas on how to get past this? I have tried doubling up the
single quote and adding double quotes at the beginning and the end of
rstrDbLocation.