Rick,
If a text string containing single and/or double
quotes in various permutations and combinations is required to be
appended to the target table by using the VALUES clause (within the
Insert SQL), each original quote (that is required to appear undisturbed in the
final result), has first to be replaced by double occurrence of the same, and
this in turn has to be enclosed within double quotes. This can be implemented
through suitable user defined function.
If the situation permits use of a text box as source,
the task can be drastically simplified by using SELECT (instead of
VALUES)clause. Raw contents of source text box can be used straightaway, without
needing any tedious conversion of text string. Either of the following
two alternatives can be used.
(a) If source text box has to be
kept unbound, it's value is fed to the SQL through a user defined
function.
(b) If the source text box can be
bound to a dedicated table (It could even be a table with single record), the
SQL can be devised in a straightforward manner.
All the alternatives outlined above, are covered (in the context of append as well as update queries) in my sample db named FixMixedQuotes at Rogers Access Library (other developers section). Link - The underlying approach could be adapted suitably for
your specific needs.
Regards,
A.D.Tejpal
--------------
Please zip all files prior to uploading to Files section. YAHOO! GROUPS LINKS
|
- [AccessDevelopers] how to handle quotes on insert allisonrja
- Re: [AccessDevelopers] how to handle quotes on insert A.D.Tejpal