Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Passthrough
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SQL Passthrough
Miscellaneous
Thread ID:
00915130
Message ID:
00915130
Views:
59
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.
Next
Reply
Map
View

Click here to load this message in the networking platform