Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Types
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00465691
Message ID:
00465805
Vues:
14
Try changing it to:
SQLInsertStr = "Insert Into EmailHistory (UniqueID, Date, MailFrom, MailTo, Subject, Body, EmailType) VALUES (" + ;
   Cstr(nextUniqueID) + ",'" + Cstr(Now())  + "','" + FromValue  + "','" + ToValue  + "','" + ;
   SubValue  + "',?BodyValue,'" + EmailTypeValue + "')"
BodyValue is actually the variable name with a ? that will make SQL Server evaluate it at insertion time and not during variable initialization.

>Larry you are right,
>
>this is what I am doing.
>SQLInsertStr = "Insert Into EmailHistory (UniqueID, Date, MailFrom, MailTo, Subject, Body, EmailType) VALUES (" + Cstr(nextUniqueID) + ",'" + Cstr(Now()) + "','" + FromValue + "','" + ToValue + "','" + SubValue + "','" + BodyValue + "','" + EmailTypeValue + "')"
>
>objConnection.execute SQLInsertStr
>
>The bodyValue is the part that contain " and '
>How could I build the string for this situation?
>
>Thanks a lot.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform