| |
Logoff Screen Saver
Printing Problems
Identifying Memory
Windows Update Problems
Links to Manufacturers
Source Code
|
The apostrophe ( ' ) sometimes referred to as a single quote can
cause SQL statements to fail when posting records to dBase and Paradox
tables. If someone's name entered in a text box was Bill O'Rielly, trying
to post the text directly to a database using a SQL statement will fail.
The reason for the failure is the apostrophe is also used to denote
the beginning and end of text in a SQL statement. Adding an additional
apostrophe ( '' ) to the name corrects the problem, (i.e. Bill O''Rielly).
Since we can not expect the user to know they should enter double quotes
instead of the correct spelling of their name in a text field, the best
way to fix it is to search the text and add the second apostrophe. The
function below is one way of accomplishing this task.
|
|
| |
This is an example of how I call this function when I am building
a SQL statement.
|
|
|
Note the extra space before the double quotes at the end of
each line except the last. They are required so the string for
the SQL statement is properly formed.
|
|
|