Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help working around single quote in string
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Help working around single quote in string
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01454787
Message ID:
01454787
Vues:
89
I have a small issue with when a user adds a single quote ' mark within the string. It doesn't happen real often, but once or twice a month, and the update fails on the sql server side.

Example:
lcUpdateString=[DC'd and intact]

I think I could write a routine that could be called and loop through the string, looking for the ' and putting it inside a set of double quotes. My questions:

1. Would that work?
2. Would it effect the vfp code below?
3. Is there an easy way to do that type of code?


VFP Code:
lcCmd=[Update dbo.co_Pat_IVTable set ]+lcUpdateTextColumn+[=']+lcUpdateString+[', ]+lcUpdateIDColumn+[= ']+lcNewValues+[']
lcCmd=lcCmd+[ where RecordID=?lnUpdateID]
>


Thanks for your thoughts, insights, suggestions

Kirk
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform