Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Apostrophe in email address
Message
De
19/03/2018 14:43:48
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01658635
Message ID:
01658818
Vues:
113
>>And in your case you already have the variables anyway. Not only is it easier to write it's secure with no possibility of SQL Injection for the variables passed.

>>cSqlInsert = "INSERT INTO EMAILSEND (FROM_NAME, FROM_EMAIL, TO_EMAIL) values " + ;
"(?lcSendName,?lcSenderEmail,?lcRecipientEmail)"

>>You just have to make sure that the variables you use are in scope when the actual SQL statement executes.
>>I thought we were past this 15+ years ago. Hmmm...

I think his issue might be that he wants it to execute at a remote server- by passing a string for macro substitution.

If so, another possibility would be a proc at the server that extracts variables from the message (param1, param2...param9) to use as parameters in the passed SQL string. Both techniques do create a risk of injection by malicious messaging, though.

Not directed at you, but for completeness: tor remote data there's two big advantages of parameters apart from sql injection-proofing and handling of quote characters:

1) In SQL Server, a parameterized query is cached to deliver almost Stored Procedure efficiency on subsequent uses; and

2) Date and datetime can be a pita when concatenating queries for different databases, esp Oracle. But parameters encapsulate that completely.

Maybe it was 15 years ago that an irritating anonymous poster called "RVBoy" used to boast that VFP's Local/Remote Views deliver all these benefits and have since 1995. ;-)
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform