Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Blocking Backslash Key Press
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01140420
Message ID:
01140464
Vues:
14
>Randal,
>
>SQLEXEC()?

Yep :^). We're doing a remote update of a MySQL database via SQLEXEC() and
ODBC. Dang. Sorry about not mentioning that we're using ODBC 3.51.

>You have two choices...
>
>1) using bind parameter
>2) escape all "forbidden" characters
PROCEDURE ToSafe(lcText)
RETURN IIF(ISNULL(lcText),"NULL","'"+STRTRAN(STRTRAN(STRTRAN(STRTRAN(STRTRAN(STRTRAN(STRTRAN(STRTRAN(STRTRAN(lcText,;
"\","\\"),CHR(0),"\0"),"'","\'"),'"','\"'),CHR(13),"\n"),CHR(10),"\r"),CHR(9),"\t"),;
"%","\%"),"_","\_")+"'")
Kewl. Thanks for the code snip, Martin. Oh, and BTW, I think that I should
mention that Sameer and I are VFP neophytes/beginners, so sometimes we don't
know what we're doing :^). Hopefully, this will change in the not-too-distant
future :^)

Randall
--
Randall Jouett
Amateur/Ham Radio: AB5NI
I eat spaghetti code out of a bit bucket while sitting at a hash table! Someone
asked me if I needed salt, and I said, "I'm not into encryption." :^)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform