Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quotes in SQL remote Views (VFP6.0 SP4)
Message
De
08/11/2000 10:58:10
 
 
À
08/11/2000 09:34:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00439118
Message ID:
00439263
Vues:
16
>One use of STRTRAN() would be to replace a single-quote with TWO single-quotes. SQL will accept this. On retrieval, however, you will see the 2 quotes. Would you STRTRAN() them on the fly back to ONE single quote ? Where would that happen ?

You need to do something like this:

lcString = "'" + STRTRAN(tuValue, "'", "''") + "'"

Use STRTRAN to convert the single quote to double single quotes to get the value into SQL. SQL will interpret this to mean, basically, "here comes a single quote". It will be stored in the table as "Mike's Pizza" and not "Mike''s Pizza" so you won't have to worry about retranslating it.
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform