Information générale
Catégorie:
Codage, syntaxe et commandes
Hi all,
I am trying to create a sql statement to insert some value to my sample table in VFP.
lcSQLStatement='INSERT INTO tasklist (department,detail) ' + ;
'VALUES (CHR(34) + thisform.txtDept.Value + CHR(34)+ ',' + CHR(34) + thisform.edtDetail.value + CHR(34) + ')' && Detail is a memo field.
nConHandle = SQLConnect(DS_NAME_1, DSN_USER_ID, DSN_PASSWORD)
= SQLPREPARE(nConHandle, lcSQLStatement)
lnSQLExecute = SQLEXEC(nConHandle)
But the problem is if you have a carriage return line feed in the 'thisform.edtDetail' control the SQLEXEC does not work. I tried with replacing the carriage return and the line feed with some other special charactors then it worked fine. But when ever you want to display the content of that field I have to remember to change back the special char to carriage return and line feed char. Is there any other way to do this.
Really appreciated.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement