We have a database file which has a semicolon in its filename, and we're trying to open the file by specifying a DBF value in a connection string (for example, via Interactive SQL's "connect with a connection string" interface), but the semicolon seems to be being treated as an argument delimiter, even when embedded inside a double-quoted string. Is there a correct way to escape the semicolon so that we can open the file via a connection string?
asked 22 Aug '12, 04:09
Using semicolons (;) as part of values that are specified as part of connection string values is not recommended and not supported. Is it possible for you to rename your file or prevent users from including semicolons in the database filename if they choose the filename? That is the recommended solution. If not then is it possible to start the server manually before the connecting to it? For example
I know that the Microsoft ODBC driver manager does not support semicolons, and semicolons in connection parameter values are not specifically supported by most client applications (including dbisql), which will result in semicolons causing connection failures. You may be able to workaround these by putting single or double quotes around the DBF connection parameter value. In order to escape quotes within a quoted string you need to double them. So for example, the following worked for me (including autostarting the server and database):
But this is not supported or recommended. Use at your own risk.