Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quotes in SQL Server
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00134836
Message ID:
00135834
Vues:
9
Use the STRTRAN function to convert your single quotes to two single quotes like this:

myString = STRTRAN(myString,"'","''")

HTH

>Version: VFP 5.0
>
>I am using SQLPREPARE() and SQLEXEC() to UPDATE and INSERT records into a SQL Server 6.5 table. In Transact-SQL, the string must be surrounded with single quotes e.g., ...SET Lname='Smith'...
>
>How can I define a string that has a single quote in it?
>Such as SET Artist='Jane's Addiction'
>
>Any thoughts?
"It is an important and popular fact that things are not always what they seem. For instance, on the planet Earth, man had always assumed that he was more intelligent than dolphins because he had achieved so much -- the wheel, New York, wars and so on -- whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man -- for precisely the same reasons." - Douglas Adams
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform