Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with SQL UPDATE via SQLEXEC
Message
From
14/04/1998 21:44:27
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00091200
Message ID:
00091999
Views:
19
>> I created a line of text similar to what was giving me problems including carriage return/line feed characters (this was before I asked for help here) and the parser accepted it with no problem.
>
>So you tried something like:>cCmd= "update clmlog set descrip='Test " + chr(13) + ;
> "Description' where recno()=13"
>SQLExec(Hndl,cCmd)
>...and that worked ok?
>
>By the way, could the problem have been related to the length of the data in the editbox?

If anyone is interested, here is what I got from Microsoft...

I've fielded this question before from other developers. This problem can
also occur if you have a quotation mark in the string that your trying to
replace into the memo field. In each case the resolution was to use the ? in
the command string as you've already discovered.

Another method that works in some cases but not all is to use the
SQLPREPARE() function to prepare the statement before passing it to SQLEXEC().
Like I said though I've had limited success with SQLPREPARE() working but have
had consistent success with using the ? in the command string. So I recommend
using the ?.

At this time that is the only resolution since foxpro will return a "Command
contains unrecognized phrase/keyword" error in the other cases.

Larry
Previous
Reply
Map
View

Click here to load this message in the networking platform